SimpleEconomy

A complete economy plugin with 14 languages, ScoreHud integration, offline player support, and a simple API.

SimpleEconomy

A production-ready economy plugin for PocketMine-MP, powered by SimpleSQL.

Built for server owners who want a working economy in minutes and developers who want an API that doesn't fight them.


Why another economy plugin?

I know BedrockEconomy exists, and it's a great plugin - recommended on Poggit, actively maintained. So why SimpleEconomy?

Short answer: Different philosophy, different strengths.

SimpleEconomyBedrockEconomy
StorageHybrid SQL + YAML via SimpleSQLPure SQL (libasynql)
API complexity4 methods. That's it.Full async ClosureAPI / fluent builders
SetupDrop-in, works instantlyRequires understanding async patterns
Offline player dataBuilt-in (temporary sessions)Requires manual SQL queries
ScoreHud integrationBuilt-inSeparate plugin required
Multi-language14 languages built-in4 languages
Transaction eventsCancellable events for third-party controlCustom event system
Target audienceSmall-to-medium servers, non-dev adminsAdvanced setups, dev-oriented

Why not PR into BedrockEconomy? BedrockEconomy is architecturally pure-SQL. SimpleEconomy's hybrid SQL-YAML approach (via SimpleSQL) is a fundamentally different storage philosophy - this isn't a feature addition, it's a different way of thinking about player data. Both approaches have merit, but they can't coexist in one codebase without compromise.

TL;DR: BedrockEconomy is powerful and flexible. SimpleEconomy is simple and instant. Choose what fits your server.


Features

  • 6 commands - /money, /pay, /setmoney, /addmoney, /reducemoney, /topmoney
  • Name prefix matching - type /money nh and it finds NhanAZ
  • Offline player support - check and modify balances of players who aren't online
  • Leaderboard - paginated /topmoney with async cache rebuild
  • 14 languages - English, Vietnamese, Korean, Russian, Spanish, Ukrainian, Chinese, Indonesian, Turkish, French, Portuguese, German, Japanese, Italian
  • ScoreHud integration - built-in scoreboard tags, no extra plugin needed
  • Transaction events - other plugins can listen to, or even cancel, economy transactions
  • Currency formatting - $1,000,000 (default) or $1.5M (compact)
  • SQLite & MySQL - switch with one line in config

Installation

From Poggit (recommended)

Download the latest .phar from Poggit CI.

Drop it in your server's plugins/ folder. Done.

From source

  1. Clone this repository
  2. The plugin requires the SimpleSQL and libasynql virions to be injected (handled automatically by Poggit CI)

Commands

CommandDescriptionPermissionDefault
/money [player]Check your balance, or someone else'ssimpleeconomy.command.moneyEveryone
/pay <player> <amount>Send money to another playersimpleeconomy.command.payEveryone
/topmoney [page]View the richest playerssimpleeconomy.command.topmoneyEveryone
/setmoney <player> <amount>Set a player's balancesimpleeconomy.command.setmoneyOP
/addmoney <player> <amount>Add money to a playersimpleeconomy.command.addmoneyOP
/reducemoney <player> <amount>Remove money from a playersimpleeconomy.command.reducemoneyOP

Tip: All commands support name prefix matching. If Steve is online, /pay st 100 works.

Tip: Admin commands (/setmoney, /addmoney, /reducemoney) work on offline players too.


Configuration

After first run, edit plugin_data/SimpleEconomy/config.yml:

# Language (14 supported)
language: "eng"

# Starting balance for new players
default-balance: 1000

# Currency display
currency:
  symbol: "$"
  formatter: "default"  # or "compact" for $1.5K style

# Leaderboard
topmoney-per-page: 10
leaderboard-size: 100

# Database (sqlite or mysql)
database:
  type: sqlite

Supported Languages

CodeLanguage
engEnglish
vieTiếng Việt
kor한국어
rusРусский
spaEspañol
ukrУкраїнська
zho简体中文
indBahasa Indonesia
turTürkçe
fraFrançais
porPortuguês
deuDeutsch
jpn日本語
itaItaliano

All language files are saved to plugin_data/SimpleEconomy/lang/ - you can edit them freely.


ScoreHud Integration

If ScoreHud is installed, SimpleEconomy automatically provides these scoreboard tags:

TagExampleDescription
{simpleeconomy.balance}$1,000Formatted balance
{simpleeconomy.rank}3Leaderboard position
{simpleeconomy.raw}1000Raw balance number

No extra plugins or configuration needed. Just add the tags to your ScoreHud config.


For Developers

Want a full working example? Check out SimpleEconomyExample - a complete plugin demonstrating how to use the SimpleEconomy API with real commands and event listeners.

Quick Start - Using the API

use NhanAZ\SimpleEconomy\Main as SimpleEconomy;

// Get the plugin instance
$eco = SimpleEconomy::getInstance();

// Check balance (online players)
$balance = $eco->getMoney("Steve");  // ?int - null if offline

// Modify balance (online players)
$eco->setMoney("Steve", 5000);    // bool - false if offline or cancelled
$eco->addMoney("Steve", 500);     // bool
$eco->reduceMoney("Steve", 200);  // bool - false if insufficient funds

// Format money using the server's configured style
$display = $eco->formatMoney(1500000);  // "$1,500,000" or "$1.5M"

That's the entire sync API. 4 methods.

Async API - Offline Players

// Works for BOTH online and offline players
$eco->getMoneyAsync("Steve", function(?int $balance): void {
    if ($balance !== null) {
        // Steve has played before, balance is $balance
    } else {
        // Steve has never joined
    }
});

Transaction Events

SimpleEconomy fires events that your plugin can listen to:

TransactionSubmitEvent - fired before a transaction executes. Cancellable.

use NhanAZ\SimpleEconomy\event\TransactionSubmitEvent;
use NhanAZ\SimpleEconomy\event\TransactionEvent;

public function onTransaction(TransactionSubmitEvent $event): void {
    // Block payments over $10,000
    if ($event->type === TransactionEvent::TYPE_PAY && $event->getAmount() > 10000) {
        $event->cancel();
    }
}

TransactionSuccessEvent - fired after a transaction completes. Read-only.

use NhanAZ\SimpleEconomy\event\TransactionSuccessEvent;

public function onSuccess(TransactionSuccessEvent $event): void {
    $this->getLogger()->info("{$event->playerName}: {$event->oldBalance} → {$event->newBalance}");
}

Event Properties

PropertyTypeDescription
$event->playerNamestringThe player involved
$event->oldBalanceintBalance before the transaction
$event->newBalanceintBalance after the transaction
$event->typestring"set", "add", "reduce", or "pay"
$event->getAmount()intAbsolute difference between old and new

Offline Player Data Access

For commands or features that need to work on offline players:

$eco->withPlayerSession("Steve", function(Session $session, bool $temporary) use ($eco): void {
    $balance = (int) $session->get("balance", 0);

    // Do something with the balance...

    // IMPORTANT: close temp sessions when done
    if ($temporary) {
        $eco->closeTempSession("Steve");
    }
}, function(string $error): void {
    // Handle error (e.g., data still loading)
});

Leaderboard Data

// Get top 10 players
$top = $eco->getTopBalances(limit: 10, offset: 0);
// Returns: [["name" => "steve", "balance" => 50000], ...]

// Get a player's rank
$rank = $eco->getPlayerRank("Steve");  // ?int - null if not in cache

// Total cached entries
$count = $eco->getBalanceCacheCount();

Multi-Economy Provider Compatibility

I plan to submit PRs to major multi-economy libraries once SimpleEconomy is approved on Poggit:

LibraryTypeConfig valuePR Status
libPiggyEconomyProvider"simpleeconomy"Planned
MoneyConnectorConnector"simpleeconomy"Planned
EconomizerTransistor"SimpleEconomy"Planned
libEcoAuto-detect-Planned
CapitalMigration source"simpleeconomy"Planned

Once these PRs are merged, plugins using these libraries (shop plugins, auction plugins, etc.) will automatically work with SimpleEconomy without any code changes on their end.


Project Structure

SimpleEconomy/
├── plugin.yml
├── LICENSE
├── resources/
│   ├── config.yml
│   ├── simplesql/
│   │   ├── mysql.sql
│   │   └── sqlite.sql
│   └── lang/
│       ├── eng.yml          # English
│       ├── vie.yml          # Tiếng Việt
│       ├── kor.yml          # 한국어
│       └── ... (14 languages)
└── src/NhanAZ/SimpleEconomy/
    ├── Main.php             # Core plugin + API
    ├── LangManager.php      # Multi-language system
    ├── CurrencyFormatter.php # $1,000 / $1K formatting
    ├── LeaderboardTask.php  # Async cache builder
    ├── ScoreHudListener.php # ScoreHud integration
    ├── command/
    │   ├── MoneyCommand.php
    │   ├── PayCommand.php
    │   ├── SetMoneyCommand.php
    │   ├── AddMoneyCommand.php
    │   ├── ReduceMoneyCommand.php
    │   └── TopMoneyCommand.php
    └── event/
        ├── TransactionEvent.php       # Base event
        ├── TransactionSubmitEvent.php  # Pre-transaction (cancellable)
        └── TransactionSuccessEvent.php # Post-transaction

License

MIT License - do whatever you want with it.


Credits

  • SimpleSQL - the hybrid SQL-YAML engine that powers this plugin
  • libasynql - async SQL library for PocketMine-MP
  • ScoreHud - scoreboard addon (optional integration)

Details

Version: 1.0.0

Downloads: 12

Updated: 2/12/2026

Supported API versions: 5.0.0 to 5.36.0

Categories: Economy, Developer Tools, Admin Tools

License: MIT

Producers

Collaborator