Class NbtTagArgument<C>
java.lang.Object
cloud.commandframework.arguments.CommandArgument<C,net.minecraft.nbt.Tag>
cloud.commandframework.fabric.argument.NbtTagArgument<C>
- Type Parameters:
C
- the sender type
- All Implemented Interfaces:
cloud.commandframework.keys.CloudKeyHolder<net.minecraft.nbt.Tag>
,Comparable<cloud.commandframework.arguments.CommandArgument<?,
?>>
public final class NbtTagArgument<C>
extends cloud.commandframework.arguments.CommandArgument<C,net.minecraft.nbt.Tag>
An argument for the string representation of an NBT
Tag
.- Since:
- 1.5.0
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <C> @NonNull NbtTagArgument.Builder<C>
Create a newNbtTagArgument.Builder
.static <C> @NonNull NbtTagArgument<C>
Create a new requiredNbtTagArgument
.static <C> @NonNull NbtTagArgument<C>
Create a new optionalNbtTagArgument
.static <C> @NonNull NbtTagArgument<C>
Create a new optionalNbtTagArgument
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 newNbtTagArgument.Builder
.- Type Parameters:
C
- Command sender type- Parameters:
name
- Name of the component- Returns:
- Created builder
- Since:
- 1.5.0
-
of
Create a new requiredNbtTagArgument
.- Type Parameters:
C
- Command sender type- Parameters:
name
- Component name- Returns:
- Created argument
- Since:
- 1.5.0
-
optional
Create a new optionalNbtTagArgument
.- Type Parameters:
C
- Command sender type- Parameters:
name
- Component name- Returns:
- Created argument
- Since:
- 1.5.0
-
optional
public static <C> @NonNull NbtTagArgument<C> optional(@NonNull String name, @NonNull net.minecraft.nbt.Tag defaultTag) Create a new optionalNbtTagArgument
with the specified default value.- Type Parameters:
C
- Command sender type- Parameters:
name
- Component namedefaultTag
- Default tag value- Returns:
- Created component
- Since:
- 1.5.0
-