Interface EventApi


public interface EventApi
This is the event api, which is used to register and call events. We use this instead of the bukkit event system to allow for cross-platform compatibility
  • Method Details

    • getInstance

      static EventApi getInstance()
      Get an instance of the event api. May be null if the plugin is not loaded yet
      Returns:
      instance
    • registerHandlers

      void registerHandlers(Object listener)
      Register a listener for events annotated with @Handler
      Parameters:
      listener - the listener to register
    • unregisterHandlers

      void unregisterHandlers(Object listener)
      Unregister a listener for events annotated with @Handler
      Parameters:
      listener - the listener to unregister
    • callEvent

      BaseEvent callEvent(BaseEvent event)
      Call an event
      Parameters:
      event - the event to call
    • registerHandler

      <T extends BaseEvent> void registerHandler(Class<T> event, SingleHandler<T> handler)
      Register a handler for a specific event
      Type Parameters:
      T - the event type
      Parameters:
      event - the event to listen for
      handler - the handler to call