Class SkriptEventHandler

java.lang.Object
ch.njol.skript.SkriptEventHandler

public final class SkriptEventHandler extends Object
  • Field Details

    • listenCancelled

      @Deprecated public static final Set<Class<? extends org.bukkit.event.Event>> 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. Requires Skript.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. Requires Skript.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. Requires Skript.logVeryHigh() to be true to log anything.
    • logTriggerStart

      public static void logTriggerStart(Trigger trigger)
      Logs that the provided Trigger has begun execution. Requires Skript.logVeryHigh() to be true.
      Parameters:
      trigger - The Trigger that execution has begun for.
    • logTriggerEnd

      public static void logTriggerEnd(Trigger t)
      Logs that the last logged Trigger execution has ended. Includes the number of milliseconds execution took. Requires Skript.logVeryHigh() to be true to log anything.
    • addSelfRegisteringTrigger

      @Deprecated public static void addSelfRegisteringTrigger(Trigger t)
      Deprecated.
      This method no longer does anything as self registered Triggers are unloaded when the SkriptEvent 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 calls registerBukkitEvent(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 a SkriptEventHandler.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

      public static void unregisterBukkitEvents(Trigger trigger)
      Unregisters all events tied to the provided Trigger.
      Parameters:
      trigger - The Trigger to unregister events for.