Class ResourceOrTagArgument<T>
java.lang.Object
net.minecraft.commands.arguments.ResourceOrTagArgument<T>
- All Implemented Interfaces:
ArgumentType<ResourceOrTagArgument.Result<T>>
public class ResourceOrTagArgument<T>
extends Object
implements ArgumentType<ResourceOrTagArgument.Result<T>>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classprivate static final recordstatic interfaceprivate static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Dynamic3CommandExceptionTypeprivate static final Dynamic2CommandExceptionTypeprivate static final Collection<String> private final ResourceKey<? extends Registry<T>> private final HolderLookup<T> -
Constructor Summary
ConstructorsConstructorDescriptionResourceOrTagArgument(CommandBuildContext context, ResourceKey<? extends Registry<T>> registryKey) -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ResourceOrTagArgument.Result<T> getResourceOrTag(CommandContext<CommandSourceStack> context, String name, ResourceKey<Registry<T>> registryKey) listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) parse(StringReader reader) static <T> ResourceOrTagArgument<T> resourceOrTag(CommandBuildContext context, ResourceKey<? extends Registry<T>> key) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ArgumentType
parse
-
Field Details
-
EXAMPLES
-
ERROR_UNKNOWN_TAG
-
ERROR_INVALID_TAG_TYPE
-
registryLookup
-
registryKey
-
-
Constructor Details
-
ResourceOrTagArgument
public ResourceOrTagArgument(CommandBuildContext context, ResourceKey<? extends Registry<T>> registryKey)
-
-
Method Details
-
resourceOrTag
public static <T> ResourceOrTagArgument<T> resourceOrTag(CommandBuildContext context, ResourceKey<? extends Registry<T>> key) -
getResourceOrTag
public static <T> ResourceOrTagArgument.Result<T> getResourceOrTag(CommandContext<CommandSourceStack> context, String name, ResourceKey<Registry<T>> registryKey) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
parse
- Specified by:
parsein interfaceArgumentType<T>- Throws:
CommandSyntaxException
-
listSuggestions
public <S> CompletableFuture<Suggestions> listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) - Specified by:
listSuggestionsin interfaceArgumentType<T>
-
getExamples
- Specified by:
getExamplesin interfaceArgumentType<T>
-