Package ch.njol.skript.lang
Class Trigger
java.lang.Object
ch.njol.skript.lang.TriggerItem
ch.njol.skript.lang.TriggerSection
ch.njol.skript.lang.Trigger
- All Implemented Interfaces:
Debuggable
-
Field Summary
Fields inherited from class ch.njol.skript.lang.TriggerSection
first, lastFields inherited from class ch.njol.skript.lang.TriggerItem
parent -
Constructor Summary
ConstructorsConstructorDescriptionTrigger(@Nullable File script, String name, SkriptEvent event, List<TriggerItem> items) -
Method Summary
Modifier and TypeMethodDescriptionbooleanexecute(org.bukkit.event.Event e)Executes this trigger for certain event.getEvent()intGets line number for this trigger's start.getName()Gets name of this trigger.@Nullable FilevoidsetDebugLabel(String label)voidsetLineNumber(int line)Sets line number for this trigger's start.toString(@Nullable org.bukkit.event.Event e, boolean debug)protected @Nullable TriggerItemwalk(org.bukkit.event.Event e)Executes this item and returns the next item to run.Methods inherited from class ch.njol.skript.lang.TriggerSection
run, setNext, setParent, setTriggerItems, walkMethods inherited from class ch.njol.skript.lang.TriggerItem
debug, getIndentation, getNext, getParent, getTrigger, toString, walk
-
Constructor Details
-
Trigger
-
-
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
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.- Specified by:
walkin classTriggerSection- Returns:
- The next item to run or null to stop execution
-
toString
- 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
Gets name of this trigger.- Returns:
- Name of trigger.
-
getEvent
-
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
-
getDebugLabel
-