Class ResourceArgument<T>

java.lang.Object
net.minecraft.commands.arguments.ResourceArgument<T>
All Implemented Interfaces:
com.mojang.brigadier.arguments.ArgumentType<Holder.Reference<T>>

public class ResourceArgument<T> extends Object implements com.mojang.brigadier.arguments.ArgumentType<Holder.Reference<T>>
  • Field Details

    • EXAMPLES

      private static final Collection<String> 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

      final ResourceKey<? extends Registry<T>> registryKey
    • registryLookup

      private final HolderLookup<T> registryLookup
  • Constructor Details

  • Method Details

    • resource

      public static <T> ResourceArgument<T> resource(CommandBuildContext p_249973_, ResourceKey<? extends Registry<T>> p_251405_)
    • getResource

      public static <T> Holder.Reference<T> getResource(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_251788_, String p_251996_, ResourceKey<Registry<T>> p_250077_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • getAttribute

      public static Holder.Reference<Attribute> getAttribute(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_248753_, String p_251157_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • getConfiguredFeature

      public static Holder.Reference<ConfiguredFeature<?,?>> getConfiguredFeature(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_250819_, String p_252256_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • getStructure

      public static Holder.Reference<Structure> getStructure(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_250288_, String p_250856_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • getEntityType

      public static Holder.Reference<EntityType<?>> getEntityType(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_251258_, String p_252322_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • getSummonableEntityType

      public static Holder.Reference<EntityType<?>> getSummonableEntityType(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_251880_, String p_250243_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • getMobEffect

      public static Holder.Reference<MobEffect> getMobEffect(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_250521_, String p_249927_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • getEnchantment

      public static Holder.Reference<Enchantment> getEnchantment(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_248656_, String p_248713_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • parse

      public Holder.Reference<T> parse(com.mojang.brigadier.StringReader p_250909_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Specified by:
      parse in interface com.mojang.brigadier.arguments.ArgumentType<T>
      Throws:
      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_)
      Specified by:
      listSuggestions in interface com.mojang.brigadier.arguments.ArgumentType<T>
    • getExamples

      public Collection<String> getExamples()
      Specified by:
      getExamples in interface com.mojang.brigadier.arguments.ArgumentType<T>