Package ch.njol.skript
Class SkriptEventHandler
java.lang.Object
ch.njol.skript.SkriptEventHandler
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
An event listener for one priority. -
Field Summary
Modifier and TypeFieldDescriptionDeprecated.Users should specify the listening behavior in the event declaration. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Deprecated.This method no longer does anything as self registered Triggers are unloaded when theSkriptEvent
is unloaded (no need to keep tracking them here).static void
Logs that the last logged Event start has ended.static void
logEventStart
(org.bukkit.event.Event event) Logs that the provided Event has started.static void
logEventStart
(org.bukkit.event.Event event, @Nullable org.bukkit.event.EventPriority priority) Logs that the provided Event has started with a priority.static void
Logs that the last logged Trigger execution has ended.static void
logTriggerStart
(Trigger trigger) Logs that the provided Trigger has begun execution.static void
registerBukkitEvent
(Trigger trigger, Class<? extends org.bukkit.event.Event> event) Registers aSkriptEventHandler.PriorityListener
with Bukkit for the provided Event.static void
registerBukkitEvents
(Trigger trigger, Class<? extends org.bukkit.event.Event>[] events) A utility method that callsregisterBukkitEvent(Trigger, Class)
for each Event class provided.static void
unregisterBukkitEvents
(Trigger trigger) Unregisters all events tied to the provided Trigger.
-
Field Details
-
listenCancelled
Deprecated.Users should specify the listening behavior in the event declaration. "on any %event%:", "on cancelled %event%:".Events which are listened even if they are cancelled. This should no longer be used.
-
-
Method Details
-
logEventStart
public static void logEventStart(org.bukkit.event.Event event) Logs that the provided Event has started. RequiresSkript.logVeryHigh()
to be true to log anything.- Parameters:
event
- The Event that started.
-
logEventStart
public static void logEventStart(org.bukkit.event.Event event, @Nullable @Nullable org.bukkit.event.EventPriority priority) Logs that the provided Event has started with a priority. RequiresSkript.logVeryHigh()
to be true to log anything.- Parameters:
event
- The Event that started.priority
- The priority of the Event.
-
logEventEnd
public static void logEventEnd()Logs that the last logged Event start has ended. Includes the number of milliseconds execution took. RequiresSkript.logVeryHigh()
to be true to log anything. -
logTriggerStart
Logs that the provided Trigger has begun execution. RequiresSkript.logVeryHigh()
to be true.- Parameters:
trigger
- The Trigger that execution has begun for.
-
logTriggerEnd
Logs that the last logged Trigger execution has ended. Includes the number of milliseconds execution took. RequiresSkript.logVeryHigh()
to be true to log anything. -
addSelfRegisteringTrigger
Deprecated.This method no longer does anything as self registered Triggers are unloaded when theSkriptEvent
is unloaded (no need to keep tracking them here). -
registerBukkitEvents
public static void registerBukkitEvents(Trigger trigger, Class<? extends org.bukkit.event.Event>[] events) A utility method that callsregisterBukkitEvent(Trigger, Class)
for each Event class provided. For specific details of the process, see the javadoc of that method.- Parameters:
trigger
- The Trigger to run when the Event occurs.events
- The Event to listen for.- See Also:
-
registerBukkitEvent
public static void registerBukkitEvent(Trigger trigger, Class<? extends org.bukkit.event.Event> event) Registers aSkriptEventHandler.PriorityListener
with Bukkit for the provided Event. Marks that the provided Trigger should be executed when the provided Event occurs.- Parameters:
trigger
- The Trigger to run when the Event occurs.event
- The Event to listen for.- See Also:
-
unregisterBukkitEvents
Unregisters all events tied to the provided Trigger.- Parameters:
trigger
- The Trigger to unregister events for.
-