Developer API
Example usage of how to use the plugin's api
Custom Events
Getting Player Data
public void modifyPlayerCoins(Player player){
// Firstly we get the player data
PlayerData playerData = MobCoinsAPI.getPlayerData();
// Return if the player data is null
if(playerData == null){
// Print something into the console
System.out.println("Modify Coins failed (reason: null player data)");
return;
}
// Now we can modify anything on the player data
// Adding coins to the player data
playerData.addCoins(10.25);
// Removing coins
playerData.removeCoins(5.50);
// See how much mobcoins does player have
System.out.println(player.getName() + " has " + playerData.getCoinsFormatted() + " coins");
}Last updated