Class ResourceOrIdArgument<T>

java.lang.Object
net.minecraft.commands.arguments.ResourceOrIdArgument<T>
All Implemented Interfaces:
com.mojang.brigadier.arguments.ArgumentType<Holder<T>>
Direct Known Subclasses:
ResourceOrIdArgument.LootModifierArgument, ResourceOrIdArgument.LootPredicateArgument, ResourceOrIdArgument.LootTableArgument

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

    • EXAMPLES

      private static final Collection<String> EXAMPLES
    • ERROR_FAILED_TO_PARSE

      public static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_FAILED_TO_PARSE
    • ERROR_INVALID

      private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_INVALID
    • registryLookup

      private final HolderLookup.Provider registryLookup
    • hasRegistry

      private final boolean hasRegistry
    • codec

      private final com.mojang.serialization.Codec<Holder<T>> codec
  • Constructor Details

  • Method Details

    • lootTable

      public static ResourceOrIdArgument.LootTableArgument lootTable(CommandBuildContext p_329328_)
    • getLootTable

      public static Holder<LootTable> getLootTable(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_335148_, String p_329251_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • lootModifier

      public static ResourceOrIdArgument.LootModifierArgument lootModifier(CommandBuildContext p_329720_)
    • getLootModifier

      public static Holder<LootItemFunction> getLootModifier(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_334458_, String p_330525_)
    • lootPredicate

      public static ResourceOrIdArgument.LootPredicateArgument lootPredicate(CommandBuildContext p_330159_)
    • getLootPredicate

      public static Holder<LootItemCondition> getLootPredicate(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_335366_, String p_334649_)
    • getResource

      private static <T> Holder<T> getResource(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_328476_, String p_329877_)
    • parse

      @Nullable public Holder<T> parse(com.mojang.brigadier.StringReader p_330381_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Specified by:
      parse in interface com.mojang.brigadier.arguments.ArgumentType<T>
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • parseInlineOrId

      static Tag parseInlineOrId(com.mojang.brigadier.StringReader p_331361_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • hasConsumedWholeArg

      private static boolean hasConsumedWholeArg(com.mojang.brigadier.StringReader p_330624_)
    • getExamples

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