Using Events

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

In Player Auctions 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 auctions here.

import com.olziedev.playerauctions.api.auction.Auction;
import com.olziedev.playerauctions.api.events.auction.PlayerAuctionSellEvent;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

public class ExampleEvents implements Listener {

    @EventHandler
    public void onAuctionSell(PlayerAuctionSellEvent event) {
        Auction auction = event.getPlayerAuction();
        Player sender = event.getSeller();
    }
}

Last updated