Package ch.njol.skript.lang
Interface DefaultExpression<T>
- All Superinterfaces:
Debuggable,Expression<T>,Loopable<T>,Simplifiable<Expression<? extends T>>,SyntaxElement
- All Known Implementing Classes:
ch.njol.skript.expressions.base.EventValueExpression,ExprCreatedDamageSource,ExprFishingHook,ExprLootContext,LitAt,LitConsole,LitDoubleMaxValue,LitDoubleMinValue,LitEternity,LitFloatMaxValue,LitFloatMinValue,LitInfinity,LitIntMaxValue,LitIntMinValue,LitLongMaxValue,LitLongMinValue,LitNaN,LitNegativeInfinity,LitNewLine,LitPi,SimpleLiteral,SimplifiedLiteral
Represents an expression that can be used as the default value of a certain type or event.
-
Method Summary
Methods inherited from interface ch.njol.skript.lang.Debuggable
toString, toStringMethods inherited from interface ch.njol.skript.lang.Expression
acceptChange, beforeChange, canBeSingle, canReturn, change, changeInPlace, changeInPlace, check, check, getAcceptedChangeModes, getAll, getAnd, getArray, getConvertedExpression, getOptionalSingle, getReturnType, getSingle, getSource, getSyntaxTypeName, getTime, isSingle, possibleReturnTypes, setTime, simplify, stream, streamAllMethods inherited from interface ch.njol.skript.lang.Loopable
isLoopOf, iterator, supportsLoopPeekingMethods inherited from interface ch.njol.skript.lang.SyntaxElement
getParser, init, preInit
-
Method Details
-
init
boolean init()Called when an expression is initialized.- Returns:
- Whether the expression is valid in its context. Skript will error if false.
-
isDefault
boolean isDefault()Description copied from interface:ExpressionReturns whether this value represents the default value of its type for the event, i.e. it can be replaced with a call to event.getXyz() if one knows the event invalid input: '&' value type.This method might be removed in the future as it's better to check whether value == event.getXyz() for every value an expression returns.
- Specified by:
isDefaultin interfaceExpression<T>- Returns:
- Usually true, though this is not required, as e.g. SimpleLiteral implements DefaultExpression but is usually not the default of an event.
-