Enum Class PacketListenerPriority
java.lang.Object
java.lang.Enum<PacketListenerPriority>
com.github.retrooper.packetevents.event.PacketListenerPriority
- All Implemented Interfaces:
Serializable
,Comparable<PacketListenerPriority>
,Constable
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
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionListener is of high importance.Listener is of critical importance.Listener is of low importance.This listener will be run first and has little say in the outcome of events.Only use this priority if you want to perform logic based on the outcome of an event.The normal listener priority. -
Method Summary
Modifier and TypeMethodDescriptionstatic PacketListenerPriority
getById
(byte id) byte
getId()
static PacketListenerPriority
Returns the enum constant of this class with the specified name.static PacketListenerPriority[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
LOWEST
This listener will be run first and has little say in the outcome of events. -
LOW
Listener is of low importance. -
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
Listener is of high importance. -
HIGHEST
Listener is of critical importance. Use this to decide the final state of packets. -
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
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
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 nameNullPointerException
- if the argument is null
-
getById
-
getId
public byte getId()
-