Annotation Interface SubscribeEvent


@Retention(RUNTIME) @Target(METHOD) public @interface SubscribeEvent
Annotation to subscribe a method to an Event

This annotation can only be applied to single parameter methods, where the single parameter is a subclass of Event.

Use IEventBus.register(Object) to submit either an Object instance or a Class to the event bus for scanning to generate callback EventListener wrappers.

The Event Bus system generates an ASM wrapper that dispatches to the marked method.

  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Returns the priority to subscribe this listener with.
    boolean
    Returns whether this listener should receive cancelled events.
  • Element Details

    • priority

      EventPriority priority
      Returns the priority to subscribe this listener with.
      Returns:
      the priority to subscribe this listener with
      Default:
      NORMAL
    • receiveCanceled

      boolean receiveCanceled
      Returns whether this listener should receive cancelled events.
      Returns:
      whether this listener should receive cancelled events
      Default:
      false