Class ItemStack
java.lang.Object
eu.sculkpowered.server.container.item.ItemStack
Represents an item.
-
Method Summary
Modifier and TypeMethodDescriptionintamount()Gets the amount of items.@NotNull ItemStackamount(int amount) Sets the amount of items.@NotNull DataComponentsGets the data components of the item.static @NotNull ItemStackempty()<T> Tget(@NotNull DataComponentType<T> type) booleanisEmpty()Returns true if this item is air.static @NotNull ItemStackstatic @NotNull ItemStackstatic @NotNull ItemStackitemStack(@NotNull Material material, int amount, @NotNull DataComponents components) static @NotNull ItemStackitemStack(@NotNull Material material, @NotNull DataComponents components) material()Gets the material of an item.toString()@NotNull ItemStackwithComponents(DataComponents components)
-
Method Details
-
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
Sets the amount of items.- Returns:
- the same item
- Since:
- 1.0.0
-
withComponents
-
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
-
toString
-
itemStack
-
itemStack
-
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
-