EyCoinsAPI
A lightweight, async coins economy API for Minecraft 1.21.1
A lightweight, async coins economy API for Minecraft 1.21.1
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✦ Features
- Fully async storage — zero main-thread blocking
- YAML & MySQL — switchable backends with HikariCP connection pool
- Transaction history — every coin change is logged per player
- Coin multipliers — temporary or permanent boost for addCoins
- Bank / Transfer — atomic coin transfers between players
- Top list — getTopPlayers(limit) ready to use
- Bukkit Events — CoinsChangeEvent (cancellable) & CoinsTransactionEvent
- Offline player support — all operations work by UUID
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✦ Storage Setup
Configure the backend in plugins/EyCoinsAPI/config.yml:
Code (YAML):
storage:
type : YAML # YAML or MYSQL
max-transactions : 50
mysql:
host : localhost
port : 3306
database : eycoinsapi
username : root
password : secret
table : eycoins_players
pool:
max-size : 10
min-idle : 2
type : YAML # YAML or MYSQL
max-transactions : 50
mysql:
host : localhost
port : 3306
database : eycoinsapi
username : root
password : secret
table : eycoins_players
pool:
max-size : 10
min-idle : 2
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✦ Developer Setup
Add EyCoinsAPI as a dependency in your plugin.yml:
Code (YAML):
depend
:
- EyCoinsAPI
- EyCoinsAPI
Code (XML):
<dependency>
<groupId>buzz.eyplugins.eynoah </groupId>
<artifactId>EyCoinsAPI </artifactId>
<version>VERSION </version>
<scope>provided </scope>
</dependency>
<groupId>buzz.eyplugins.eynoah </groupId>
<artifactId>EyCoinsAPI </artifactId>
<version>VERSION </version>
<scope>provided </scope>
</dependency>
Code (Java):
CoinsAPI coinsAPI
= EyCoinsAPI.
getInstance
(
).
getCoinsAPI
(
)
;
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✦ API Reference
All methods return CompletableFuture — use .thenAccept() for callbacks.
» Coins
Code (Java):
// Get
coinsAPI. getCoins (player ). thenAccept (coins -> player. sendMessage ( "Balance: " + coins ) ) ;
// Set
coinsAPI. setCoins (player, 500.0, "Admin reset" ) ;
// Add (multiplier is applied automatically)
coinsAPI. addCoins (player, 100.0, "Quest reward" ) ;
// Remove (returns false if not enough coins)
coinsAPI. removeCoins (player, 50.0, "Shop purchase" ). thenAccept (success -> {
if ( !success ) player. sendMessage ( "Not enough coins!" ) ;
} ) ;
// Check
coinsAPI. hasCoins (player, 200.0 ). thenAccept (has -> { ... } ) ;
coinsAPI. getCoins (player ). thenAccept (coins -> player. sendMessage ( "Balance: " + coins ) ) ;
// Set
coinsAPI. setCoins (player, 500.0, "Admin reset" ) ;
// Add (multiplier is applied automatically)
coinsAPI. addCoins (player, 100.0, "Quest reward" ) ;
// Remove (returns false if not enough coins)
coinsAPI. removeCoins (player, 50.0, "Shop purchase" ). thenAccept (success -> {
if ( !success ) player. sendMessage ( "Not enough coins!" ) ;
} ) ;
// Check
coinsAPI. hasCoins (player, 200.0 ). thenAccept (has -> { ... } ) ;
Code (Java):
coinsAPI.
transferCoins
(fromPlayer, toPlayer,
250.0,
"Trade"
).
thenAccept
(success
->
{
if ( !success ) fromPlayer. sendMessage ( "Transfer failed." ) ;
} ) ;
if ( !success ) fromPlayer. sendMessage ( "Transfer failed." ) ;
} ) ;
Code (Java):
coinsAPI.
getHistory
(player,
10
).
thenAccept
(transactions
->
{
for (CoinTransaction tx : transactions ) {
// tx.getType(), tx.getAmount(), tx.getBalanceBefore(),
// tx.getBalanceAfter(), tx.getReason(), tx.getTimestamp()
}
} ) ;
for (CoinTransaction tx : transactions ) {
// tx.getType(), tx.getAmount(), tx.getBalanceBefore(),
// tx.getBalanceAfter(), tx.getReason(), tx.getTimestamp()
}
} ) ;
Code (Java):
Code (Java):
// 2x multiplier for 1 hour
coinsAPI. setMultiplier (player, 2.0, 3600 ) ;
// Permanent (duration = 0)
coinsAPI. setMultiplier (uuid, 1.5, 0 ) ;
// Query
double multi = coinsAPI. getEffectiveMultiplier (uuid ) ; // 1.0 if none
boolean active = coinsAPI. hasMultiplier (uuid ) ;
Multiplier m = coinsAPI. getMultiplier (uuid ) ; // null if none/expired
// Remove
coinsAPI. removeMultiplier (player ) ;
coinsAPI. setMultiplier (player, 2.0, 3600 ) ;
// Permanent (duration = 0)
coinsAPI. setMultiplier (uuid, 1.5, 0 ) ;
// Query
double multi = coinsAPI. getEffectiveMultiplier (uuid ) ; // 1.0 if none
boolean active = coinsAPI. hasMultiplier (uuid ) ;
Multiplier m = coinsAPI. getMultiplier (uuid ) ; // null if none/expired
// Remove
coinsAPI. removeMultiplier (player ) ;
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✦ Events
» CoinsChangeEvent — fired before every change, cancellable
Code (Java):
@EventHandler
public void onCoinsChange (CoinsChangeEvent event ) {
// Modify the final amount
event. setNewAmount (event. getNewAmount ( ) * 2 ) ;
// Or cancel entirely
event. setCancelled ( true ) ;
}
public void onCoinsChange (CoinsChangeEvent event ) {
// Modify the final amount
event. setNewAmount (event. getNewAmount ( ) * 2 ) ;
// Or cancel entirely
event. setCancelled ( true ) ;
}
Code (Java):
@EventHandler
public void onTransaction (CoinsTransactionEvent event ) {
CoinTransaction tx = event. getTransaction ( ) ;
// log, sync, notify, etc.
}
public void onTransaction (CoinsTransactionEvent event ) {
CoinTransaction tx = event. getTransaction ( ) ;
// log, sync, notify, etc.
}
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✦ Commands & Permissions
| Command | Description | Permission |
| /coins | Show your own balance | eycoinsapi.coins |
| /coins <player> | Show another player's balance | eycoinsapi.coins |
| /coins top [limit] | Show top coin holders | eycoinsapi.coins |
| /coins <player> set <amount> | Set a player's coins | eycoinsapi.coins.others |
| /coins <player> add <amount> | Add coins to a player | eycoinsapi.coins.others |
| /coins <player> remove <amount> | Remove coins from a player | eycoinsapi.coins.others |
| /coins <player> transfer <amount> | Transfer coins to another player | eycoinsapi.coins.others |
| /coins <player> history [limit] | View transaction history | eycoinsapi.coins.others |
| /coins <player> multiplier [value] [secs] | Get or set coin multiplier | eycoinsapi.admin |
Quick facts
- Edition: Minecraft Java
- File type: .jar
- Minecraft version listed: 1.21
- How to install: Install the matching mod loader (Forge, Fabric or NeoForge) for your Minecraft version. → Download the .jar. → Put it in the .minecraft/mods folder and launch that loader profile.
- Where to get it: Opens on Spigot — not every file is mirrored on our own servers.
Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.
EyCoinsAPI is a free Minecraft Java mod. Compatible with Minecraft 1.21. Downloaded 13 times (via Spigot). Download it and open it directly in the game.