This plugin adds the concept of money to the server.
Wallet data held by the player is stored in .json
format and I/O asynchronously.
As for the Option setting, you can change the asynchronous setting to your liking. Basically, there is no need to change the default settings.
- use binary version
8.0.10
- use PocketMine-MP version
API4-beta11+dev2067
use pocketmine\player\Player;
use oiran\walletlib\api\WalletLib;
use oiran\walletlib\dto\WalletDTO;
/** @var $player Player */
$xuid = $player->getXuid();
$wallet = WalletLib::findWallet($xuid);
$moneyAmount = $wallet->getMoney()->getAmount();
use oiran\walletlib\model\Money;
$wallet->earn(200);
$wallet->spend(100);
$to = WalletLib::findWallet("to player xuid");
$from = WalletLib::findWallet("from player xuid");
$from->payTo($to, 300);