Class ItemStack

java.lang.Object
eu.sculkpowered.server.container.item.ItemStack

public final class ItemStack extends Object
Represents an item.
  • Method Details

    • material

      public Material material()
      Gets the material of an item.
      Returns:
      the material of item
      Since:
      1.0.0
    • amount

      public int amount()
      Gets the amount of items.
      Returns:
      the amount of items
      Since:
      1.0.0
    • amount

      @NotNull public @NotNull ItemStack amount(int amount)
      Sets the amount of items.
      Returns:
      the same item
      Since:
      1.0.0
    • withComponents

      @NotNull public @NotNull ItemStack withComponents(DataComponents components)
    • components

      @NotNull public @NotNull DataComponents components()
      Gets the data components of the item.
      Returns:
      the data components of the item
      Since:
      1.0.0
    • isEmpty

      public boolean isEmpty()
      Returns true if this item is air.
      Returns:
      true if it is empty.
      Since:
      1.0.0
    • get

      public <T> T get(@NotNull @NotNull DataComponentType<T> type)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • itemStack

      @NotNull public static @NotNull ItemStack itemStack(@NotNull @NotNull Material material)
    • itemStack

      @NotNull public static @NotNull ItemStack itemStack(@NotNull @NotNull Material material, int amount)
    • itemStack

      @NotNull public static @NotNull ItemStack itemStack(@NotNull @NotNull Material material, @NotNull @NotNull DataComponents components)
    • itemStack

      @NotNull public static @NotNull ItemStack itemStack(@NotNull @NotNull Material material, int amount, @NotNull @NotNull DataComponents components)
    • empty

      @NotNull public static @NotNull ItemStack empty()