Using Events

Here you can view details on how to listen to events using the API.

In Player Economy you can listen to events using the API, this will allow you to listen to events that happen in the plugin. It uses the Bukkit event system so you should be familiar with that.

Examples

Here is an example of a listener class, this will let you be able to listen to events that happen in the plugin. Here is a list of events you can listen for Economy here.

import com.olziedev.playereconomy.api.player.EPlayer;
import com.olziedev.playereconomy.api.events.player.PlayerEconomyDepositEvent;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

public class ExampleEvents implements Listener {

    @EventHandler
    public void onEcoDeposit(PlayerEconomyDepositEvent event) {
        EPlayer player = event.getEcoPlayer();
        double amount = event.getAmount();
    }
}

Last updated