Class ExprMinMaxEnchantmentLevel
- All Implemented Interfaces:
Debuggable, Expression<Integer>, Loopable<Integer>, Simplifiable<Expression<? extends Integer>>, SyntaxElement, Converter<org.bukkit.enchantments.Enchantment, Integer>, RuntimeErrorProducer, SyntaxRuntimeErrorProducer
@Name("Minimum/Maximum Enchantment Level")
@Description("The minimum or maximum allowed level in Minecraft of a particular <a href='#enchantment'>enchantment</a>.\n\nThe minimum starting level is 1 for all existing enchantments as of 26.1.2.\n")
@Example("set {_maximum} to the maximum enchantment level of sharpness\nif the level of sharpness of the player's tool is greater than {_maximum}:\n\tsend \"<gold>Your tool's sharpness level was capped out at the maximum allowed level.</gold>\"\n\tset the level of sharpness of the player's tool to {_maximum}\n") @Example("set {_min} to the minimum enchantment level of sharpness\nset {_max} to the maximum enchantment level of sharpness\nloop integers between {_min} and {_max}:\n\tset slot loop-counter of {_gui} to enchanted book named \"Sharpness %loop-value%\" with lore \"<reset>Click to enchant!\"\n")
@Since("2.16")
public class ExprMinMaxEnchantmentLevel
extends ch.njol.skript.expressions.base.SimplePropertyExpression<org.bukkit.enchantments.Enchantment, Integer>
-
Field Summary
Fields inherited from class ch.njol.skript.expressions.base.SimplePropertyExpression
rawExprFields inherited from class ch.njol.skript.expressions.base.PropertyExpression
DEFAULT_PRIORITYFields inherited from interface Converter
ALL_CHAINING, ALLOW_UNSAFE_CASTS, NO_CHAINING, NO_LEFT_CHAINING, NO_RIGHT_CHAINING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription@Nullable Integerconvert(org.bukkit.enchantments.Enchantment from) Converts an object using this Converter.protected StringGets the return type of this expression.booleaninit(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult) Called just after the constructor andSyntaxElement.preInit().static voidregister(SyntaxRegistry registry) Methods inherited from class ch.njol.skript.expressions.base.SimplePropertyExpression
get, toStringMethods inherited from class ch.njol.skript.expressions.base.PropertyExpression
get, get, getAll, getAnd, getDefaultPatterns, getExpr, getPatterns, infoBuilder, isSingle, register, register, registerDefault, registerDefault, setExpr, simplifyMethods inherited from class SimpleExpression
acceptChange, change, check, check, check, getArray, getConvertedExpr, getConvertedExpression, getNode, getSingle, getSource, getTime, isDefault, isLoopOf, iterator, preInit, setTime, setTime, setTime, setTime, setTime, supportsLoopPeeking, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Expression
beforeChange, canBeSingle, canReturn, canReturnAnyOf, changeInPlace, changeInPlace, getAcceptedChangeModes, getOptionalSingle, getSyntaxTypeName, possibleReturnTypes, returnNestedStructures, returnsNestedStructures, stream, streamAllMethods inherited from interface RuntimeErrorProducer
error, error, getRuntimeErrorManager, warning, warningMethods inherited from interface SyntaxElement
getParserMethods inherited from interface SyntaxRuntimeErrorProducer
getErrorSource
-
Constructor Details
-
ExprMinMaxEnchantmentLevel
public ExprMinMaxEnchantmentLevel()
-
-
Method Details
-
register
-
init
public boolean init(Expression<?>[] expressions, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult) Description copied from interface:SyntaxElementCalled just after the constructor andSyntaxElement.preInit().- Specified by:
initin interfaceSyntaxElement- Overrides:
initin classch.njol.skript.expressions.base.SimplePropertyExpression<org.bukkit.enchantments.Enchantment, Integer>- Parameters:
expressions- all %expr%s included in the matching pattern in the order they appear in the pattern. If an optional value was left out, it will still be included in this list holding the default value of the desired type, which usually depends on the event.matchedPattern- The index of the pattern which matchedisDelayed- Whether this expression is used after a delay or not (i.e. if the event has already passed when this expression will be called)parseResult- Additional information about the match.- Returns:
- Whether this expression was initialised successfully. An error should be printed prior to returning false to specify the cause.
- See Also:
-
convert
Description copied from interface:ConverterConverts an object using this Converter. -
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)
-
getPropertyName
-