Class ResourceOrTagKeyArgument<T>
java.lang.Object
net.minecraft.commands.arguments.ResourceOrTagKeyArgument<T>
- All Implemented Interfaces:
ArgumentType<ResourceOrTagKeyArgument.Result<T>>
public class ResourceOrTagKeyArgument<T>
extends Object
implements ArgumentType<ResourceOrTagKeyArgument.Result<T>>
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classprivate static final recordstatic interfaceprivate static final record -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Collection<String> private final ResourceKey<? extends Registry<T>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ResourceOrTagKeyArgument.Result<T> getResourceOrTagKey(CommandContext<CommandSourceStack> context, String name, ResourceKey<Registry<T>> registryKey, DynamicCommandExceptionType exceptionType) listSuggestions(CommandContext<S> context, SuggestionsBuilder builder) parse(StringReader reader) static <T> ResourceOrTagKeyArgument<T> resourceOrTagKey(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
-
registryKey
-
-
Constructor Details
-
ResourceOrTagKeyArgument
-
-
Method Details
-
resourceOrTagKey
public static <T> ResourceOrTagKeyArgument<T> resourceOrTagKey(ResourceKey<? extends Registry<T>> key) -
getResourceOrTagKey
public static <T> ResourceOrTagKeyArgument.Result<T> getResourceOrTagKey(CommandContext<CommandSourceStack> context, String name, ResourceKey<Registry<T>> registryKey, DynamicCommandExceptionType exceptionType) 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>
-