Promotion background
Halloween Season IS HERE!
10% off limited time offer!
limited time offer SAVE 10% NOW →
API API

Events

On this page, you will find every event the Phoenix Currencies API fires.

#Events

Both are ordinary Bukkit events in com.phoenixplugins.phoenixcurrencies.api.events, fired on the main thread. Neither can be cancelled.

Event Fired when Carries
BalanceChangeEvent A balance changed, for any reason getPlayer() (a UUID), getCurrency(), getPrevious(), getBalance(), getReason()
LeaderboardRefreshEvent The leaderboards were worked out again getCurrencies(), the ids that were refreshed

getReason() is the kind of change as a short key, such as pay, give, exchange or vault, the same kinds the translation file names under reasons. The player can be offline, so look them up with Bukkit.getPlayer(uuid) before treating them as online.

@EventHandler
public void onBalanceChange(BalanceChangeEvent event) {
    if (!event.getCurrency().getId().equals("gems")) {
        return;
    }

    Player player = Bukkit.getPlayer(event.getPlayer());

    if (player != null && event.getBalance() >= 1000 && event.getPrevious() < 1000) {
        player.sendMessage("You reached 1,000 gems!");
    }
}
Last updated about 2 hours ago
My Cart (0 items)

Oops... looks like the spiders padded through here

Add products to your cart and remove them from here Lets buy