Package ch.njol.skript.expressions
Class ExprDamageCause
java.lang.Object
ch.njol.skript.lang.util.SimpleExpression<T>
ch.njol.skript.expressions.base.EventValueExpression<org.bukkit.event.entity.EntityDamageEvent.DamageCause>
ch.njol.skript.expressions.ExprDamageCause
- All Implemented Interfaces:
Debuggable
,DefaultExpression<org.bukkit.event.entity.EntityDamageEvent.DamageCause>
,Expression<org.bukkit.event.entity.EntityDamageEvent.DamageCause>
,SyntaxElement
@Name("Damage Cause")
@Description("The <a href=\'./classes.html#damagecause\'>damage cause</a> of a damage event. Please click on the link for more information.")
@Examples("damage cause is lava, fire or burning")
@Since("2.0")
public class ExprDamageCause
extends EventValueExpression<org.bukkit.event.entity.EntityDamageEvent.DamageCause>
-
Constructor Summary
-
Method Summary
Methods inherited from class ch.njol.skript.expressions.base.EventValueExpression
acceptChange, change, get, getReturnType, init, init, isDefault, isSingle
Methods inherited from class ch.njol.skript.lang.util.SimpleExpression
check, check, check, getAll, getAnd, getArray, getConvertedExpr, getConvertedExpression, getSingle, getSource, getTime, isLoopOf, iterator, setTime, setTime, setTime, simplify, toString
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.Expression
beforeChange, check, check, getAll, getAnd, getArray, getConvertedExpression, getSingle, getSource, getTime, isLoopOf, iterator, simplify, stream
Methods inherited from interface ch.njol.skript.lang.SyntaxElement
getParser
-
Constructor Details
-
ExprDamageCause
public ExprDamageCause()
-
-
Method Details
-
setTime
public boolean setTime(int time)Description copied from class:SimpleExpression
Sets the time of this expression, i.e. whether the returned value represents this expression before or after the event.This method will not be called if this expression is guaranteed to be used after a delay (an error will be printed immediately), but will be called if it only can be after a delay (e.g. if the preceding delay is in an if or a loop) as well as if there's no delay involved.
If this method returns false the expression will be discarded and an error message is printed. Custom error messages must be of
ErrorQuality.SEMANTIC_ERROR
to be printed (NB:Skript.error(String)
always creates semantic errors).This implementation sets the time but returns false.
- Specified by:
setTime
in interfaceExpression<org.bukkit.event.entity.EntityDamageEvent.DamageCause>
- Overrides:
setTime
in classEventValueExpression<org.bukkit.event.entity.EntityDamageEvent.DamageCause>
- Parameters:
time
- -1 for past or 1 for future. 0 is never passed to this method as it represents the default state.- Returns:
- Whether this expression has distinct time states, e.g. a player never changes but a block can. This should be sensitive for the event (using
ParserInstance.isCurrentEvent(Class)
). - See Also:
SimpleExpression.setTime(int, Class, Expression...)
,SimpleExpression.setTime(int, Expression, Class...)
-
toString
- Specified by:
toString
in interfaceDebuggable
- Overrides:
toString
in classEventValueExpression<org.bukkit.event.entity.EntityDamageEvent.DamageCause>
- 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
-