Class TriggerSection

java.lang.Object
ch.njol.skript.lang.TriggerItem
ch.njol.skript.lang.TriggerSection
All Implemented Interfaces:
Debuggable
Direct Known Subclasses:
Section, Trigger

public abstract class TriggerSection extends TriggerItem
Represents a section of a trigger, e.g. a conditional or a loop
  • Field Details

  • Constructor Details

    • TriggerSection

      protected TriggerSection(List<TriggerItem> items)
      Reserved for new Trigger(...)
    • TriggerSection

      protected TriggerSection(SectionNode node)
    • TriggerSection

      protected TriggerSection()
      Important when using this constructor: set the items with setTriggerItems(List)!
  • Method Details

    • setTriggerItems

      protected void setTriggerItems(List<TriggerItem> items)
      Remember to add this section to ParserInstance.getCurrentSections() before parsing child elements!
       ScriptLoader.currentSections.add(this);
       setTriggerItems(ScriptLoader.loadItems(node));
       ScriptLoader.currentSections.remove(ScriptLoader.currentSections.size() - 1);
       
    • setNext

      public TriggerSection setNext(@Nullable TriggerItem next)
      Overrides:
      setNext in class TriggerItem
    • setParent

      public TriggerSection setParent(@Nullable TriggerSection parent)
      Overrides:
      setParent in class TriggerItem
    • run

      protected final boolean run(org.bukkit.event.Event e)
      Description copied from class: TriggerItem
      Executes this item.
      Specified by:
      run in class TriggerItem
      Returns:
      True if the next item should be run, or false for the item following this item's parent.
    • walk

      protected abstract @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.

      Overrides:
      walk in class TriggerItem
      Returns:
      The next item to run or null to stop execution
    • walk

      protected final @Nullable TriggerItem walk(org.bukkit.event.Event e, boolean run)