Package ch.njol.skript.expressions
Class ExprTypeOf
java.lang.Object
ch.njol.skript.lang.util.SimpleExpression<T>
ch.njol.skript.expressions.base.PropertyExpression<F,T>
ch.njol.skript.expressions.base.SimplePropertyExpression<Object,Object>
ch.njol.skript.expressions.ExprTypeOf
- All Implemented Interfaces:
Converter<Object,Object>,Debuggable,Expression<Object>,SyntaxElement
@Name("Type of")
@Description({"Type of a block, item, entity, inventory or potion effect.","Types of items and blocks are item types similar to them but have amounts","of one, no display names and, on Minecraft 1.13 and newer versions, are undamaged.","Types of entities and inventories are entity types and inventory types known to Skript.","Types of potion effects are potion effect types."})
@Examples({"on rightclick on an entity:","\tmessage \"This is a %type of clicked entity%!\""})
@Since("1.4, 2.5.2 (potion effect)")
public class ExprTypeOf
extends SimplePropertyExpression<Object,Object>
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.njol.skript.classes.Converter
Converter.ConverterInfo<F,T>, Converter.ConverterUtils -
Field Summary
Fields inherited from interface ch.njol.skript.classes.Converter
NO_CHAINING, NO_COMMAND_ARGUMENTS, NO_LEFT_CHAINING, NO_RIGHT_CHAINING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable ObjectConverts an object from the given to the desired type.protected <R> @Nullable ConvertedExpression<Object,? extends R>getConvertedExpr(Class<R>... to)Converts this expression to another type.protected StringGets the return type of this expression.Methods inherited from class ch.njol.skript.expressions.base.SimplePropertyExpression
get, init, toStringMethods inherited from class ch.njol.skript.expressions.base.PropertyExpression
get, get, getAll, getAnd, getExpr, isSingle, register, setExpr, simplifyMethods inherited from class ch.njol.skript.lang.util.SimpleExpression
acceptChange, change, check, check, check, getArray, getConvertedExpression, getSingle, getSource, getTime, isDefault, isLoopOf, iterator, setTime, setTime, setTime, setTime, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface ch.njol.skript.lang.Expression
beforeChange, streamMethods inherited from interface ch.njol.skript.lang.SyntaxElement
getParser
-
Constructor Details
-
ExprTypeOf
public ExprTypeOf()
-
-
Method Details
-
getPropertyName
- Specified by:
getPropertyNamein classSimplePropertyExpression<Object,Object>
-
convert
Description copied from interface:ConverterConverts an object from the given to the desired type. -
getReturnType
Description copied from interface:ExpressionGets the return type of this expression.- Returns:
- A supertype of any objects returned by
Expression.getSingle(Event)and the component type of any arrays returned byExpression.getArray(Event)
-
getConvertedExpr
Description copied from class:SimpleExpressionConverts this expression to another type. Unless the expression is special, the default implementation is sufficient.This method is never called with a supertype of the return type of this expression, or the return type itself.
- Overrides:
getConvertedExprin classSimpleExpression<Object>- Parameters:
to- The desired return type of the returned expression- Returns:
- Expression with the desired return type or null if it can't be converted to the given type
- See Also:
Expression.getConvertedExpression(Class...),ConvertedExpression.newInstance(Expression, Class...),Converter
-