Package ch.njol.skript.lang
Class Effect
java.lang.Object
ch.njol.skript.lang.TriggerItem
ch.njol.skript.lang.Statement
ch.njol.skript.lang.Effect
- All Implemented Interfaces:
Debuggable,SyntaxElement,RuntimeErrorProducer,SyntaxRuntimeErrorProducer
- Direct Known Subclasses:
AsyncEffect,EffAllowAging,EffBreedable,EffBrewingConsume,EffectSectionEffect,EffEquipCompDamageable,EffEquipCompDispensable,EffEquipCompInteract,EffEquipCompShearable,EffEquipCompSwapEquipment,EffFishingLure,EffGenerateLoot,EffMakeAdultOrBaby,EffPullHookedEntity,EffRegisterTag,EffRotate,EffTextDisplayDropShadow,EffTextDisplaySeeThroughBlocks
An effect which is unconditionally executed when reached, and execution will usually continue with the next item of the trigger after this effect is executed (the stop effect
for example stops the trigger, i.e. nothing else will be executed after it)
- See Also:
-
Field Summary
Fields inherited from class ch.njol.skript.lang.TriggerItem
parent -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidexecute(org.bukkit.event.Event event) Executes this effect.getNode()Returns the sourceNodefor any errors the implementing class emits.@NotNull Stringstatic @Nullable EffectbooleanpreInit()Called immediately after the constructor.final booleanrun(org.bukkit.event.Event event) Executes this item.Methods inherited from class ch.njol.skript.lang.TriggerItem
debug, executionIntent, getActualNext, getIndentation, getNext, getParent, getTrigger, setNext, setParent, toString, walk, 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
toStringMethods inherited from interface org.skriptlang.skript.log.runtime.RuntimeErrorProducer
error, error, getRuntimeErrorManager, warning, warningMethods inherited from interface ch.njol.skript.lang.SyntaxElement
getParser, initMethods inherited from interface org.skriptlang.skript.log.runtime.SyntaxRuntimeErrorProducer
getErrorSource
-
Constructor Details
-
Effect
protected Effect()
-
-
Method Details
-
preInit
public boolean preInit()Description copied from interface:SyntaxElementCalled immediately after the constructor. This should be used to do any work that need to be done prior to downstream initialization. This is not intended to be used by syntaxes directly, but by parent classes to do work prior to the initialization of the child classes.- Specified by:
preInitin interfaceSyntaxElement- Returns:
- Whether this expression was pre-initialised successfully. An error should be printed prior to returning false to specify the cause.
-
execute
protected abstract void execute(org.bukkit.event.Event event) Executes this effect.- Parameters:
event- The event with which this effect will be executed
-
run
public 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.
-
parse
-
getNode
Description copied from interface:SyntaxRuntimeErrorProducerReturns the sourceNodefor any errors the implementing class emits.
Used for accessing the line contents viaNode.getKey()and the line number viaNode.getLine().
A standard implementation is to store the Node duringSyntaxElement.init(Expression[], int, Kleenean, SkriptParser.ParseResult)viaParserInstance.getNode().- Specified by:
getNodein interfaceSyntaxRuntimeErrorProducer- Returns:
- The source that produced a runtime error.
-
getSyntaxTypeName
- Specified by:
getSyntaxTypeNamein interfaceSyntaxElement- Returns:
- A string naming the type of syntax this is. e.g. "expression", "section".
-