Class ItemInputArgument<C>
java.lang.Object
cloud.commandframework.arguments.CommandArgument<C,net.minecraft.commands.arguments.item.ItemInput>
cloud.commandframework.fabric.argument.ItemInputArgument<C>
- Type Parameters:
C
- the sender type
- All Implemented Interfaces:
cloud.commandframework.keys.CloudKeyHolder<net.minecraft.commands.arguments.item.ItemInput>
,Comparable<cloud.commandframework.arguments.CommandArgument<?,
?>>
public final class ItemInputArgument<C>
extends cloud.commandframework.arguments.CommandArgument<C,net.minecraft.commands.arguments.item.ItemInput>
An argument parsing an item identifier and optional extra NBT data into an
ItemInput
.- Since:
- 1.5.0
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <C> @NonNull ItemInputArgument.Builder<C>
Create a newItemInputArgument.Builder
.static <C> @NonNull ItemInputArgument<C>
Create a new requiredItemInputArgument
.static <C> @NonNull ItemInputArgument<C>
Create a new optionalItemInputArgument
.static <C> @NonNull ItemInputArgument<C>
Create a new optionalItemInputArgument
with the specified default value.Methods inherited from class cloud.commandframework.arguments.CommandArgument
addPreprocessor, compareTo, copy, equals, getDefaultDescription, getDefaultValue, getKey, getName, getOwningCommand, getParser, getSuggestionsProvider, getValueType, hasDefaultValue, hashCode, isArgumentRegistered, isRequired, ofType, ofType, preprocess, setArgumentRegistered, setOwningCommand, toString
-
Method Details
-
builder
Create a newItemInputArgument.Builder
.- Type Parameters:
C
- Command sender type- Parameters:
name
- Name of the argument- Returns:
- Created builder
- Since:
- 1.5.0
-
of
Create a new requiredItemInputArgument
.- Type Parameters:
C
- Command sender type- Parameters:
name
- Component name- Returns:
- Created argument
- Since:
- 1.5.0
-
optional
Create a new optionalItemInputArgument
.- Type Parameters:
C
- Command sender type- Parameters:
name
- Component name- Returns:
- Created argument
- Since:
- 1.5.0
-
optional
public static <C> @NonNull ItemInputArgument<C> optional(@NonNull String name, @NonNull net.minecraft.world.item.ItemStack defaultValue) Create a new optionalItemInputArgument
with the specified default value.- Type Parameters:
C
- Command sender type- Parameters:
name
- Argument namedefaultValue
- Default value- Returns:
- Created argument
- Since:
- 1.5.0
-