Class ItemStack
java.lang.Object
eu.sculkpowered.server.container.item.ItemStack
Represents an item.
-
Method Summary
Modifier and TypeMethodDescriptionint
amount()
Gets the amount of items.@NotNull ItemStack
amount
(int amount) Sets the amount of items.@NotNull DataComponents
Gets the data components of the item.static @NotNull ItemStack
empty()
<T> T
get
(@NotNull DataComponentType<T> type) boolean
isEmpty()
Returns true if this item is air.static @NotNull ItemStack
static @NotNull ItemStack
static @NotNull ItemStack
itemStack
(@NotNull Material material, int amount, @NotNull DataComponents components) static @NotNull ItemStack
itemStack
(@NotNull Material material, @NotNull DataComponents components) material()
Gets the material of an item.toString()
@NotNull ItemStack
withComponents
(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
-