Enum Class PacketListenerPriority

java.lang.Object
java.lang.Enum<PacketListenerPriority>
com.github.retrooper.packetevents.event.PacketListenerPriority
All Implemented Interfaces:
Serializable, Comparable<PacketListenerPriority>, Constable

public enum PacketListenerPriority extends Enum<PacketListenerPriority>
The priority of packet listeners affect the order they will be invoked in. The lowest priority listeners are invoked first, the most high ones are invoked last. The most high priority listener has the final decider on an event being cancelled. This priority can be specified in the PacketListenerAbstract constructor. If you don't specify a priority in the constructor, it will use the NORMAL priority.
Since:
1.8
  • Enum Constant Details

    • LOWEST

      public static final PacketListenerPriority LOWEST
      This listener will be run first and has little say in the outcome of events.
    • LOW

      public static final PacketListenerPriority LOW
      Listener is of low importance.
    • NORMAL

      public static final PacketListenerPriority NORMAL
      The normal listener priority. If possible, always pick this. It allows other projects to easily overturn your decisions. Moreover, it is pretty bold to assume that your project should always have the final say.
    • HIGH

      public static final PacketListenerPriority HIGH
      Listener is of high importance.
    • HIGHEST

      public static final PacketListenerPriority HIGHEST
      Listener is of critical importance. Use this to decide the final state of packets.
    • MONITOR

      public static final PacketListenerPriority MONITOR
      Only use this priority if you want to perform logic based on the outcome of an event. Please do not modify packets in this stage.
  • Method Details

    • values

      public static PacketListenerPriority[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static PacketListenerPriority valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getById

      public static PacketListenerPriority getById(byte id)
    • getId

      public byte getId()