Package ch.njol.skript.lang
Class Condition
java.lang.Object
ch.njol.skript.lang.TriggerItem
ch.njol.skript.lang.Statement
ch.njol.skript.lang.Condition
- All Implemented Interfaces:
Debuggable
,SyntaxElement
- Direct Known Subclasses:
CondAlphanumeric
,CondCanBuild
,CondCancelled
,CondCanHold
,CondCanSee
,CondChance
,CondCompare
,CondContains
,CondDamageCause
,CondDate
,CondHasMetadata
,CondHasPotion
,CondHasRelationalVariable
,CondHasScoreboardTag
,CondIncendiary
,CondIsBlockRedstonePowered
,CondIsEnchanted
,CondIsInWorld
,CondIsLoaded
,CondIsMember
,CondIsOfType
,CondIsPluginEnabled
,CondIsRiding
,CondIsSet
,CondIsWearing
,CondIsWhitelisted
,CondItemInHand
,CondMatches
,CondMinecraftVersion
,CondPermission
,CondPlayedBefore
,CondPvP
,CondRegionContains
,CondResourcePack
,CondScriptLoaded
,CondStartsEndsWith
,CondWeather
,PropertyCondition
A condition which must be fulfilled for the trigger to continue. If the condition is in a section the behaviour depends on the section.
-
Field Summary
Fields inherited from class ch.njol.skript.lang.TriggerItem
parent
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
check(org.bukkit.event.Event e)
Checks whether this condition is satisfied with the given event.boolean
static @Nullable Condition
boolean
run(org.bukkit.event.Event e)
Executes this item.protected void
setNegated(boolean invert)
Sets the negation state of this condition.Methods inherited from class ch.njol.skript.lang.TriggerItem
debug, getIndentation, getNext, getParent, getTrigger, setNext, setParent, toString, walk, walk
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.njol.skript.lang.Debuggable
toString
Methods inherited from interface ch.njol.skript.lang.SyntaxElement
getParser, init
-
Constructor Details
-
Condition
protected Condition()
-
-
Method Details
-
check
public abstract boolean check(org.bukkit.event.Event e)Checks whether this condition is satisfied with the given event. This should not alter the event or the world in any way, as conditions are only checked until one returns false. All subsequent conditions of the same trigger will then be omitted.
You might want to useSimpleExpression.check(Event, Checker)
- Parameters:
e
- the event to check- Returns:
true
if the condition is satisfied,false
otherwise or if the condition doesn't apply to this event.
-
run
public final boolean run(org.bukkit.event.Event e)Description copied from class:TriggerItem
Executes this item.- Specified by:
run
in classTriggerItem
- Returns:
- True if the next item should be run, or false for the item following this item's parent.
-
setNegated
protected final void setNegated(boolean invert)Sets the negation state of this condition. This will change the behaviour ofExpression.check(Event, Checker, boolean)
. -
isNegated
public final boolean isNegated()- Returns:
- whether this condition is negated or not.
-
parse
-