Using Events

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

In Player Warps 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 warps here.

import com.olziedev.playerwarps.api.events.warp.PlayerWarpCreateEvent;
import com.olziedev.playerwarps.api.warp.Warp;
import org.bukkit.command.CommandSender;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;

public class ExampleEvents implements Listener {
    
    @EventHandler
    public void onWarpCreate(PlayerWarpCreateEvent event) {
        Warp warp = event.getPlayerWarp();
        CommandSender creator = event.getCreator();
    }
}

Last updated