Class ItemInputArgument<C>

java.lang.Object
cloud.commandframework.arguments.CommandArgument<C,net.minecraft.commands.arguments.item.ItemInput>
cloud.commandframework.fabric.argument.ItemInputArgument<C>
Type Parameters:
C - the sender type
All Implemented Interfaces:
cloud.commandframework.keys.CloudKeyHolder<net.minecraft.commands.arguments.item.ItemInput>, Comparable<cloud.commandframework.arguments.CommandArgument<?,?>>

public final class ItemInputArgument<C> extends cloud.commandframework.arguments.CommandArgument<C,net.minecraft.commands.arguments.item.ItemInput>
An argument parsing an item identifier and optional extra NBT data into an ItemInput.
Since:
1.5.0
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Builder for ItemInputArgument.

    Nested classes/interfaces inherited from class cloud.commandframework.arguments.CommandArgument

    cloud.commandframework.arguments.CommandArgument.TypedBuilder<C extends Object,T extends Object,B extends cloud.commandframework.arguments.CommandArgument.Builder<C,T>>
  • Method Summary

    Modifier and Type
    Method
    Description
    static <C> @NonNull ItemInputArgument.Builder<C>
    builder(@NonNull String name)
    static <C> @NonNull ItemInputArgument<C>
    of(@NonNull String name)
    Create a new required ItemInputArgument.
    static <C> @NonNull ItemInputArgument<C>
    optional(@NonNull String name)
    Create a new optional ItemInputArgument.
    static <C> @NonNull ItemInputArgument<C>
    optional(@NonNull String name, @NonNull net.minecraft.world.item.ItemStack defaultValue)
    Create a new optional ItemInputArgument with the specified default value.

    Methods inherited from class cloud.commandframework.arguments.CommandArgument

    addPreprocessor, compareTo, copy, equals, getDefaultDescription, getDefaultValue, getKey, getName, getOwningCommand, getParser, getSuggestionsProvider, getValueType, hasDefaultValue, hashCode, isArgumentRegistered, isRequired, ofType, ofType, preprocess, setArgumentRegistered, setOwningCommand, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Method Details

    • builder

      public static <C> @NonNull ItemInputArgument.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 ItemInputArgument<C> of(@NonNull String name)
      Create a new required ItemInputArgument.
      Type Parameters:
      C - Command sender type
      Parameters:
      name - Component name
      Returns:
      Created argument
      Since:
      1.5.0
    • optional

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

      public static <C> @NonNull ItemInputArgument<C> optional(@NonNull String name, @NonNull net.minecraft.world.item.ItemStack defaultValue)
      Create a new optional ItemInputArgument with the specified default value.
      Type Parameters:
      C - Command sender type
      Parameters:
      name - Argument name
      defaultValue - Default value
      Returns:
      Created argument
      Since:
      1.5.0