Class Trigger

All Implemented Interfaces:
Debuggable

public class Trigger extends TriggerSection
  • Constructor Details

  • Method Details

    • execute

      public boolean execute(org.bukkit.event.Event e)
      Executes this trigger for certain event.
      Parameters:
      e - Event.
      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()
      Gets name of this trigger.
      Returns:
      Name of trigger.
    • getEvent

      public SkriptEvent getEvent()
    • getScript

      public @Nullable File getScript()
    • 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()
      Gets line number for this trigger's start. Only use it for debugging!
      Returns:
      Line number.
    • setDebugLabel

      public void setDebugLabel(String label)
    • getDebugLabel

      public String getDebugLabel()