Class ItemArgument

java.lang.Object
com.zenith.command.brigadier.ItemArgument
All Implemented Interfaces:
com.mojang.brigadier.arguments.ArgumentType<ItemData>, SerializableArgumentType<ItemData>

public class ItemArgument extends Object implements SerializableArgumentType<ItemData>
Does not support the full vanilla item arg syntax with data components like `minecraft:stone{Count:1b}` only supports parsing from an item name
  • Field Details

    • INVALID_ITEM_EXCEPTION

      public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType INVALID_ITEM_EXCEPTION
  • Constructor Details

    • ItemArgument

      public ItemArgument()
  • Method Details

    • item

      public static ItemArgument item()
    • parse

      public ItemData parse(com.mojang.brigadier.StringReader reader) throws com.mojang.brigadier.exceptions.CommandSyntaxException
      Specified by:
      parse in interface com.mojang.brigadier.arguments.ArgumentType<ItemData>
      Throws:
      com.mojang.brigadier.exceptions.CommandSyntaxException
    • getItem

      public static ItemData getItem(com.mojang.brigadier.context.CommandContext<CommandContext> context, String name)
    • commandParser

      public @NonNull CommandParser commandParser()
      Specified by:
      commandParser in interface SerializableArgumentType<ItemData>
    • listSuggestions

      public CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> listSuggestions(com.mojang.brigadier.context.CommandContext context, com.mojang.brigadier.suggestion.SuggestionsBuilder builder)
      Specified by:
      listSuggestions in interface com.mojang.brigadier.arguments.ArgumentType<ItemData>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object