This plugin add new currences and api economy
Two-way economic A.P.I. to create currencies on the one hand, and on the other the usual economic plugin PocketMine-MP 5 README RU
Main:
use gft\cur\API;
/* ... */
API::getCurrencyManager()->registerCurrency($main->getName(), new YourCurrency());
/* ... */
Instead of YourCurrency the class of your currency Your Currency:
<?php
namespace your\plugin\space;
use gft\cur\currency\Currency;
class YourCurrency implements Currency {
public function getPrice(): float {
return 1;
}
public function getExchangeable(): string {
return "Dollar";
}
public function onBuy(float $count): void { /* code */ }
public function onSell(float $count): void { /* code */ }
public function setPrice(float $price): void { /* code */ }
public function getName(): string {
return "Currency"; // currency name
}
public function getSing(): string {
return "C"; // sing
}
public function isBuyable(): bool { return true; }
public function isSalable(): bool { return true; }
public function maxCount(): float { return PHP_float_MAX; }
public function buyLimit(): float { return PHP_float_NAX; }
public function sellLimit(): float { return PHP_float_MAX; }
}
Add to balance:
$player->add($currencyName, $count);
For remove from balance:
$player->remove($currencyName, $count);
For set balance:
$player->set($currencyName, $count);
For complete transaction:
$player->transaction($currencyName, $count, $player);
For get balance
$count = $player->get($currencyName);
/[currency]
Version: 1.6
Downloads: 13
Updated: 5/27/2026
Supported API versions: 5.36.0 to 5.36.0
Categories: API plugins, Fun, Economy, Mechanics
License: GPL-3.0