Handling events
Last updated
Last updated
You may listen to any Bukkit-based event (including events added by other plugins) by referencing the imported class. For example, if you wanted to listen to :
Some plugins use their own event handling system or do not pass their events through Bukkit's event executor (which is the case with some of Skript's internal events).
In order to listen to an event, it must extend and be executed by Bukkit's event executor.
You may also listen to multiple events with the same handler. The events do not have to be related, but you should take appropriate precautions if you try to access methods that are available in one event but not in the other. For example, if you want to listen to both and
event
expressionskript-mirror exposes an event
expression, allowing you to access event values using reflection.
The priority level of an event may be set to control when a particular event handler is run relative to other event handlers.
highest
is the highest priority event handler you should use if you are modifying the contents of an event. If you only care about the final result of the event, use monitor
.
By default, event handlers will not be called if an event is cancelled by a lower priority handler. This behavior can be changed by specifying that the handler should handle all
events.
Any event priorities defined in may be used. Lower priority event handlers are run before higher priority event handlers.