An economy plugin for different Minecraft server environments powered by Reactor Core with a wide-range of supported platforms and versions.
- R2DBC (database connectivity)
- adventure (UI library)
- cloud (in-game command framework)
- caffeine (high-performance caching library)
-
Bukkit for Java Edition:
-
Nukkit for Bedrock:
- PowerNukkit (for 1.18 and above)
- or any fork that runs on >1.0.0
POSTGRESQL
- Discover connection through the PostgreSQLMYSQL
- Discover connection through the MySQL
Name | Description | Default value |
---|---|---|
MONEYBOX_STARTING_BALANCE |
Default balance amount | 0 |
MONEYBOX_DATASOURCE |
Data source type | POSTGRESQL |
MONEYBOX_DATASOURCE_HOST |
Data source host | 127.0.0.1 |
MONEYBOX_DATASOURCE_PORT |
Data source port | 5432 |
MONEYBOX_DATASOURCE_USER |
Data source username | app |
MONEYBOX_DATASOURCE_PASSWORD |
Data source password | gbplf |
MONEYBOX_DATASOURCE_DB |
Data source database | app |
-
You can retrieve an instance of Moneybox API via platform's Service Manager API
- Bukkit:
MoneyboxApi api = getServer().getServicesManager().getRegistration(MoneyboxApi.class).getProvider();
- Nukkit:
MoneyboxApi api = getServer().getServiceManager().getProvider(MoneyboxApi.class).getProvider();
- Bukkit:
-
Deposit player an amount then send a message asynchronously.
api.depositBalanceAsync(username, amount).doOnSuccess($ -> { sender.sendMessage("You have deposit %d for player %s".formatted(amount, username)); }).subscribe();
-
Retrieve a balance amount of a player then send it asynchronously.
api.getBalanceAsync(username) .subscribe(balance -> sender.sendMessage("Balance amount of %s is %d".formatted(username, balance));
-
Retrieve a balance amount of an online player then send it.
long balance = api.getCachedBalance(MoneyboxPlayer.of(username)); sender.sendMessage("Balance amount of %s is %d".formatted(username, balance));