Package ch.njol.skript.lang
Class TriggerSection
java.lang.Object
ch.njol.skript.lang.TriggerItem
ch.njol.skript.lang.TriggerSection
- All Implemented Interfaces:
Debuggable
Represents a section of a trigger, e.g. a conditional or a loop
-
Field Summary
FieldsFields inherited from class ch.njol.skript.lang.TriggerItem
parent -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedImportant when using this constructor: set the items withsetTriggerItems(List)!protectedTriggerSection(SectionNode node) protectedTriggerSection(List<TriggerItem> items) Reserved for new Trigger(...) -
Method Summary
Modifier and TypeMethodDescriptionprotected final booleanrun(org.bukkit.event.Event event) Executes this item.setNext(@Nullable TriggerItem next) setParent(@Nullable TriggerSection parent) protected voidsetTriggerItems(List<TriggerItem> items) Remember to add this section toParserInstance.getCurrentSections()before parsing child elements!protected @Nullable ExecutionIntentprotected abstract @Nullable TriggerItemwalk(org.bukkit.event.Event event) Executes this item and returns the next item to run.protected final @Nullable TriggerItemwalk(org.bukkit.event.Event event, boolean run) Methods inherited from class ch.njol.skript.lang.TriggerItem
debug, executionIntent, getActualNext, getIndentation, getNext, getParent, getTrigger, toString, walkMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.njol.skript.lang.Debuggable
toString
-
Field Details
-
first
-
last
-
-
Constructor Details
-
TriggerSection
Reserved for new Trigger(...) -
TriggerSection
-
TriggerSection
protected TriggerSection()Important when using this constructor: set the items withsetTriggerItems(List)!
-
-
Method Details
-
setTriggerItems
Remember to add this section toParserInstance.getCurrentSections()before parsing child elements!ScriptLoader.currentSections.add(this); setTriggerItems(ScriptLoader.loadItems(node)); ScriptLoader.currentSections.remove(ScriptLoader.currentSections.size() - 1);
-
setNext
- Overrides:
setNextin classTriggerItem
-
setParent
- Overrides:
setParentin classTriggerItem
-
run
protected final boolean run(org.bukkit.event.Event event) Description copied from class:TriggerItemExecutes this item.- Specified by:
runin classTriggerItem- Parameters:
event- The event to run this item with- Returns:
- True if the next item should be run, or false for the item following this item's parent.
-
walk
Description copied from class:TriggerItemExecutes 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:
walkin classTriggerItem- Parameters:
event- The event- Returns:
- The next item to run or null to stop execution
-
walk
-
triggerExecutionIntent
- Returns:
- The execution intent of the section's trigger.
-