Class ItemStackArgument<C>

java.lang.Object
cloud.commandframework.arguments.CommandArgument<C,ProtoItemStack>
cloud.commandframework.bukkit.parsers.ItemStackArgument<C>
Type Parameters:
C - Command sender type
All Implemented Interfaces:
cloud.commandframework.keys.CloudKeyHolder<ProtoItemStack>, Comparable<cloud.commandframework.arguments.CommandArgument<?,?>>

public final class ItemStackArgument<C> extends cloud.commandframework.arguments.CommandArgument<C,ProtoItemStack>
Argument type for parsing a Material and optional extra NBT data into a ProtoItemStack.

This argument type only provides basic suggestions by default. On Minecraft 1.13 and newer, enabling Brigadier compatibility through BukkitCommandManager.registerBrigadier() will allow client side validation and suggestions to be utilized.

Since:
1.5.0
  • Method Details

    • builder

      public static <C> @NonNull ItemStackArgument.Builder<C> builder(@NonNull String name)
      Type Parameters:
      C - Command sender type
      Parameters:
      name - Name of the argument
      Returns:
      Created builder
      Since:
      1.5.0
    • of

      public static <C> @NonNull ItemStackArgument<C> of(@NonNull String name)
      Create a new required ItemStackArgument.
      Type Parameters:
      C - Command sender type
      Parameters:
      name - Argument name
      Returns:
      Created argument
      Since:
      1.5.0
    • optional

      public static <C> @NonNull ItemStackArgument<C> optional(@NonNull String name)
      Create a new optional ItemStackArgument.
      Type Parameters:
      C - Command sender type
      Parameters:
      name - Argument name
      Returns:
      Created argument
      Since:
      1.5.0