Annotation Type Listener


  • @Retention(RUNTIME)
    @Target(METHOD)
    public @interface Listener
    Used to annotate a method as an EventListener.

    The method being targeted must be public and must be in a class that is also public.

    • Optional Element Summary

      Optional Elements 
      Modifier and Type Optional Element Description
      boolean beforeModifications
      Whether this listener should be called before any other server mods, such as Forge mods.
      Order order
      The order this listener should be called in relation to other listeners in the EventManager.
    • Element Detail

      • order

        Order order
        The order this listener should be called in relation to other listeners in the EventManager.
        Returns:
        The order the listener should be called in
        Default:
        org.spongepowered.api.event.Order.DEFAULT
      • beforeModifications

        boolean beforeModifications
        Whether this listener should be called before any other server mods, such as Forge mods. All Sponge event listeners are called after mods, unless they specify the #beforeModifications() flag to be true.
        Returns:
        If the listener should be fired before other server mods
        Default:
        false