Annotation Interface SubscribeEvent


@Retention(RUNTIME) @Target(METHOD) public @interface SubscribeEvent
Marks a method as an event handler. The method must have exactly one parameter whose type extends Event.

 @SubscribeEvent
 private void onAttack(AttackEvent event) { ... }

 @SubscribeEvent(priority = EventPriority.HIGH)
 private void onPacket(PacketEvent event) { ... }
 
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
     
  • Element Details