Listener

Here we explain and demonstrate how you can create and register listeners for Wale events.

How do I create a listener?

public class YourListenerName implements EventListener {

    // The @Eventable annoation must be used
    @Eventable
    public void handle(ChannelMessageEvent event) {
        // Handle the event
    }
}

How do I register a listener?

We recommend registering the listeners when loading the plugins.

Attention: Your plugin must be loaded after the Wale plugin if you are using events or the API when loading your plugin. Here is an example for the plugin.yml and bungee.yml

# spigot.yml or bungee.yml (same method)
depend:
  - Wale
public class Test extends JavaPlugin {
    
    @Override
    public void onEnable() {
        EventDispatcher.addListener(new ListenerWale());
    }
}

Last updated