类 ResourceArgument<T>
java.lang.Object
net.minecraft.commands.arguments.ResourceArgument<T>
- 所有已实现的接口:
com.mojang.brigadier.arguments.ArgumentType<Holder.Reference<T>>
public class ResourceArgument<T>
extends Object
implements com.mojang.brigadier.arguments.ArgumentType<Holder.Reference<T>>
-
嵌套类概要
嵌套类 -
字段概要
字段修饰符和类型字段说明static final com.mojang.brigadier.exceptions.Dynamic3CommandExceptionType
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType
static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType
private static final Collection<String>
(专用程序包) final ResourceKey<? extends Registry<T>>
private final HolderLookup<T>
-
构造器概要
构造器构造器说明ResourceArgument
(CommandBuildContext pContext, ResourceKey<? extends Registry<T>> pRegistryKey) -
方法概要
修饰符和类型方法说明static Holder.Reference<Attribute>
getAttribute
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument) static Holder.Reference<ConfiguredFeature<?,
?>> getConfiguredFeature
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument) static Holder.Reference<Enchantment>
getEnchantment
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument) static Holder.Reference<EntityType<?>>
getEntityType
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument) static Holder.Reference<MobEffect>
getMobEffect
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument) static <T> Holder.Reference<T>
getResource
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument, ResourceKey<Registry<T>> pRegistryKey) static Holder.Reference<Structure>
getStructure
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument) static Holder.Reference<EntityType<?>>
getSummonableEntityType
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument) <S> CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
listSuggestions
(com.mojang.brigadier.context.CommandContext<S> p_249391_, com.mojang.brigadier.suggestion.SuggestionsBuilder p_251197_) parse
(com.mojang.brigadier.StringReader pBuilder) static <T> ResourceArgument<T>
resource
(CommandBuildContext pContext, ResourceKey<? extends Registry<T>> pRegistryKey)
-
字段详细资料
-
EXAMPLES
-
ERROR_NOT_SUMMONABLE_ENTITY
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_NOT_SUMMONABLE_ENTITY -
ERROR_UNKNOWN_RESOURCE
public static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType ERROR_UNKNOWN_RESOURCE -
ERROR_INVALID_RESOURCE_TYPE
public static final com.mojang.brigadier.exceptions.Dynamic3CommandExceptionType ERROR_INVALID_RESOURCE_TYPE -
registryKey
-
registryLookup
-
-
构造器详细资料
-
ResourceArgument
public ResourceArgument(CommandBuildContext pContext, ResourceKey<? extends Registry<T>> pRegistryKey)
-
-
方法详细资料
-
resource
public static <T> ResourceArgument<T> resource(CommandBuildContext pContext, ResourceKey<? extends Registry<T>> pRegistryKey) -
getResource
public static <T> Holder.Reference<T> getResource(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument, ResourceKey<Registry<T>> pRegistryKey) throws com.mojang.brigadier.exceptions.CommandSyntaxException - 抛出:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getAttribute
public static Holder.Reference<Attribute> getAttribute(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument) throws com.mojang.brigadier.exceptions.CommandSyntaxException - 抛出:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getConfiguredFeature
public static Holder.Reference<ConfiguredFeature<?,?>> getConfiguredFeature(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument) throws com.mojang.brigadier.exceptions.CommandSyntaxException - 抛出:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getStructure
public static Holder.Reference<Structure> getStructure(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument) throws com.mojang.brigadier.exceptions.CommandSyntaxException - 抛出:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getEntityType
public static Holder.Reference<EntityType<?>> getEntityType(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument) throws com.mojang.brigadier.exceptions.CommandSyntaxException - 抛出:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getSummonableEntityType
public static Holder.Reference<EntityType<?>> getSummonableEntityType(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument) throws com.mojang.brigadier.exceptions.CommandSyntaxException - 抛出:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getMobEffect
public static Holder.Reference<MobEffect> getMobEffect(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument) throws com.mojang.brigadier.exceptions.CommandSyntaxException - 抛出:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getEnchantment
public static Holder.Reference<Enchantment> getEnchantment(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, String pArgument) throws com.mojang.brigadier.exceptions.CommandSyntaxException - 抛出:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
parse
public Holder.Reference<T> parse(com.mojang.brigadier.StringReader pBuilder) throws com.mojang.brigadier.exceptions.CommandSyntaxException - 指定者:
parse
在接口中com.mojang.brigadier.arguments.ArgumentType<T>
- 抛出:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
listSuggestions
public <S> CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> listSuggestions(com.mojang.brigadier.context.CommandContext<S> p_249391_, com.mojang.brigadier.suggestion.SuggestionsBuilder p_251197_) - 指定者:
listSuggestions
在接口中com.mojang.brigadier.arguments.ArgumentType<T>
-
getExamples
- 指定者:
getExamples
在接口中com.mojang.brigadier.arguments.ArgumentType<T>
-