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_335938_)
    • getLootTable

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

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

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

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

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

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

      @Nullable public Holder<T> parse(com.mojang.brigadier.StringReader p_335906_) 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_335947_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • hasConsumedWholeArg

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

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