Class ArgumentItemStack
java.lang.Object
net.minestom.server.command.builder.arguments.Argument<ItemStack>
net.minestom.server.command.builder.arguments.minecraft.ArgumentItemStack
Argument which can be used to retrieve an
ItemStack
from its material and with NBT data.
It is the same type as the one used in the /give command.
Example: diamond_sword{display:{Name:"{\"text\":\"Sword of Power\"}"}}
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
static final int
static final int
Fields inherited from class net.minestom.server.command.builder.arguments.Argument
allowSpace, CONTAINER, suggestionType, useRemaining
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription@NotNull ItemStack
parse
(@NotNull CommandSender sender, @NotNull String input) Parses the given input, and throw anArgumentSyntaxException
if the input cannot be converted toT
parser()
static ItemStack
staticParse
(@NotNull String input) Deprecated.toString()
Methods inherited from class net.minestom.server.command.builder.arguments.Argument
allowSpace, equals, filter, getCallback, getDefaultValue, getId, getSuggestionCallback, hasErrorCallback, hashCode, hasSuggestion, isOptional, map, map, nodeProperties, parse, setCallback, setDefaultValue, setDefaultValue, setDefaultValue, setSuggestionCallback, suggestionType, useRemaining
-
Field Details
-
NO_MATERIAL
public static final int NO_MATERIAL- See Also:
-
INVALID_NBT
public static final int INVALID_NBT- See Also:
-
INVALID_MATERIAL
public static final int INVALID_MATERIAL- See Also:
-
-
Constructor Details
-
ArgumentItemStack
-
-
Method Details
-
parse
@NotNull public @NotNull ItemStack parse(@NotNull @NotNull CommandSender sender, @NotNull @NotNull String input) throws ArgumentSyntaxException Description copied from class:Argument
Parses the given input, and throw anArgumentSyntaxException
if the input cannot be converted toT
- Specified by:
parse
in classArgument<ItemStack>
- Parameters:
input
- the argument to parse- Returns:
- the parsed argument
- Throws:
ArgumentSyntaxException
- ifvalue
is not valid
-
parser
-
staticParse
@Deprecated public static ItemStack staticParse(@NotNull @NotNull String input) throws ArgumentSyntaxException Deprecated.- Throws:
ArgumentSyntaxException
-
toString
-
Argument.parse(CommandSender, Argument)