Super simple economic system to add to your server.
ScoreHud is supported and the tag to display the balance is:
Tag = {mineconomy.balance}
When adding the tag to the scorehuds settings please note that the tag comes with the "$" for example: {mineconomy.balance} => $1,000
- View yours or someone else's balance
- Pay player's
- Add, remove and set money
- ScoreHud integration
- Leaderboards
- Custom currency symbols
- Custom messages
- ScoreHud integration
- Custom messages and custom currency symbols
- Leaderboards
- Floating text displaying the leaderboards
- Requires PocketMine-MP API 5.36.0-latest
Need this exact plugin but for BetterAltay or NukkitX?
Check them out here!
- Click me for BetterAltay version (soon...)
- Click me for NukkitX version (soon...)
How to get the main instance
//Import this class
use byteforge88\mineconomy\Mineconomy;
$api = Mineconomy::getInstance();How to check if a player exists in the database
//You may pass either the player class or a string (username) as the first parameter
//$player is an instance of Player::class
$player
//or
$name = "steve";
if ($api->isNew($player)) {
$player->sendMessage("Player not found!");
return;
}
//or
if ($api->isNew($name)) {
//returns true meaning the player doesn't exist
return;
}
//If player exists it will ignore the statementHow to retrieve a player's balance
//You may pass either the player class or a string (username) as the first parameter
//$player is an instance of Player::class
$player
//or
$name = "steve";
$api->getBalance($player);
//or
$api->getBalance($name);How to add money to a player's balance
//You may pass either the player class or a string (username) as the first parameter
//$player is an instance of Player::class
$player
//or
$name = "steve";
$api->addMoneyToBalance($player, 1000);
//or
$api->addMoneyToBalance($name, 1000);How to remove money from a player's balance
//You may pass either the player class or a string (username) as the first parameter
//$player is an instance of Player::class
$player
//or
$name = "steve";
$api->removeMoneyFromBalance($player, 1000);
//or
$api->removeMoneyFromBalance($name, 1000);How to set a player's balance
//You may pass either the player class or a string (username) as the first parameter
//$player is an instance of Player::class
$player
//or
$name = "steve";
$api->setBalance($player, 1000);
//or
$api->setBalance($name, 1000);Random but may be useful, format amounts
$api->formatMoney(1000);
//outcome: $1,000