Custom Events
All custom events that are available in this plugin
@EventHandler
public void onCoinsReceived(MobCoinsReceiveEvent event){
// Get the player that's involved in this event
Player player = event.getPlayer();
// We want to multiply the coins received if the
// player has 'mobcoins.multiply.2' permissions.
if(player.hasPermission("mobcoins.multiply.2")){
// Get the amount player receives
double coinsReceived = event.getAmountReceived();
event.setAmountReceived((coinsReceived * 2));
}
// Get the amount received after being multiply
double finalAmount = event.getAmountReceived();
// We want to cancel the event if player recevies
// mobcoins greather than 3000
if(finalAmount > 3000){
// If cancelled, player will not receives
// the mobcoins
event.setCancelled(true);
}
}Last updated