Class Trigger

All Implemented Interfaces:
Debuggable

public class Trigger extends TriggerSection
  • Constructor Details

  • Method Details

    • execute

      public boolean execute(org.bukkit.event.Event event)
      Executes this trigger for a certain event.
      Parameters:
      event - The event to execute this Trigger with.
      Returns:
      false if an exception occurred.
    • walk

      protected @Nullable TriggerItem walk(org.bukkit.event.Event e)
      Description copied from class: TriggerItem
      Executes this item and returns the next item to run.

      Overriding classes must call TriggerItem.debug(Event, boolean). If this method is overridden, TriggerItem.run(Event) is not used anymore and can be ignored.

      Specified by:
      walk in class TriggerSection
      Returns:
      The next item to run or null to stop execution
    • toString

      public String toString(@Nullable org.bukkit.event.Event e, boolean debug)
      Parameters:
      e - The event to get information to. This is always null if debug == false.
      debug - If true this should print more information, if false this should print what is shown to the end user
      Returns:
      String representation of this object
    • getName

      public String getName()
      Returns:
      The name of this trigger.
    • getEvent

      public SkriptEvent getEvent()
    • getScript

      public @Nullable Script getScript()
      Returns:
      The script this trigger was created from.
    • setLineNumber

      public void setLineNumber(int line)
      Sets line number for this trigger's start. Only used for debugging.
      Parameters:
      line - Line number
    • getLineNumber

      public int getLineNumber()
      Returns:
      The line number where this trigger starts. This should ONLY be used for debugging!
    • setDebugLabel

      public void setDebugLabel(String label)
    • getDebugLabel

      public String getDebugLabel()