Annotation Interface EventHandler


@Target(METHOD) @Retention(RUNTIME) public @interface EventHandler
Annotation to mark methods as event handlers in plugin classes. Methods annotated with this will be automatically registered as event handlers.

Example usage:


@EventHandler(priority = EventPriority.NORMAL)
public void onMessageReceived(MessageReceivedEvent event) {
    // Handle the event
}

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    boolean
    Whether to ignore cancelled events.
    The priority of this event handler.
  • Element Details

    • priority

      EventPriority priority
      The priority of this event handler.
      Returns:
      the event priority
      Default:
      NORMAL
    • ignoreCancelled

      boolean ignoreCancelled
      Whether to ignore cancelled events.
      Returns:
      true to ignore cancelled events
      Default:
      false