Class ItemParser

java.lang.Object
net.minecraft.commands.arguments.item.ItemParser

public class ItemParser extends Object
  • Field Details

    • ERROR_NO_TAGS_ALLOWED

      private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_NO_TAGS_ALLOWED
    • ERROR_UNKNOWN_ITEM

      private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_UNKNOWN_ITEM
    • ERROR_UNKNOWN_TAG

      private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_UNKNOWN_TAG
    • SYNTAX_START_NBT

      private static final char SYNTAX_START_NBT
      See Also:
    • SYNTAX_TAG

      private static final char SYNTAX_TAG
      See Also:
    • SUGGEST_NOTHING

      private static final Function<com.mojang.brigadier.suggestion.SuggestionsBuilder,CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> SUGGEST_NOTHING
    • items

      private final HolderLookup<Item> items
    • reader

      private final com.mojang.brigadier.StringReader reader
    • allowTags

      private final boolean allowTags
    • result

      private com.mojang.datafixers.util.Either<Holder<Item>,HolderSet<Item>> result
    • nbt

      @Nullable private CompoundTag nbt
    • suggestions

      private Function<com.mojang.brigadier.suggestion.SuggestionsBuilder,CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>> suggestions
  • Constructor Details

    • ItemParser

      private ItemParser(HolderLookup<Item> p_235291_, com.mojang.brigadier.StringReader p_235292_, boolean p_235293_)
  • Method Details

    • parseForItem

      public static ItemParser.ItemResult parseForItem(HolderLookup<Item> p_235306_, com.mojang.brigadier.StringReader p_235307_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • parseForTesting

      public static com.mojang.datafixers.util.Either<ItemParser.ItemResult,ItemParser.TagResult> parseForTesting(HolderLookup<Item> p_235320_, com.mojang.brigadier.StringReader p_235321_) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • fillSuggestions

      public static CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> fillSuggestions(HolderLookup<Item> p_235309_, com.mojang.brigadier.suggestion.SuggestionsBuilder p_235310_, boolean p_235311_)
    • readItem

      private void readItem() throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • readTag

      private void readTag() throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • readNbt

      private void readNbt() throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • parse

      private void parse() throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • suggestOpenNbt

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestOpenNbt(com.mojang.brigadier.suggestion.SuggestionsBuilder p_235298_)
    • suggestTag

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestTag(com.mojang.brigadier.suggestion.SuggestionsBuilder p_235318_)
    • suggestItem

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestItem(com.mojang.brigadier.suggestion.SuggestionsBuilder p_235323_)
    • suggestItemIdOrTag

      private CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> suggestItemIdOrTag(com.mojang.brigadier.suggestion.SuggestionsBuilder p_235326_)