Package org.core.inventory.item.stack
Interface ItemStack
- All Known Subinterfaces:
ItemStackSnapshot
,LiveItemStack
public interface ItemStack
-
Method Summary
Modifier and TypeMethodDescriptioncopy()
Copies this ItemStackcopyWithQuantity(int quantity)
Copies this ItemStack with a specified quantityCreates a snapshot of this itemList<net.kyori.adventure.text.Component>
getLore()
Gets the lore of the itemint
Gets the amount of items within this stackGets the ItemStackData of this item.@NotNull ItemType
getType()
Gets the type of item of this itemStacksetLore(Collection<? extends net.kyori.adventure.text.Component> lore)
Sets the lore of the itemdefault ItemStack
setLore(net.kyori.adventure.text.Component... lines)
default ItemStack
setLore(net.kyori.adventure.text.ComponentLike... lines)
void
setStackData(ItemStackData data)
Sets the itemStackData of this item
-
Method Details
-
getType
Gets the type of item of this itemStack- Returns:
- The itemType of this itemStack
-
getQuantity
int getQuantity()Gets the amount of items within this stack- Returns:
- The amount of items in this itemstack
-
getLore
List<net.kyori.adventure.text.Component> getLore()Gets the lore of the item- Returns:
- The lore of the item
-
setLore
Sets the lore of the item -
setLore
-
setLore
-
copy
ItemStack copy()Copies this ItemStack- Returns:
- The copied itemstack
-
copyWithQuantity
Copies this ItemStack with a specified quantity- Parameters:
quantity
- The new size- Returns:
- The copied itemstack
-
getStackData
Optional<ItemStackData> getStackData()Gets the ItemStackData of this item.- Returns:
- The ItemStackData if there is one
-
setStackData
Sets the itemStackData of this item- Parameters:
data
- The new ItemStackData- Throws:
IllegalArgumentException
- When the
-
createSnapshot
ItemStackSnapshot createSnapshot()Creates a snapshot of this item- Returns:
- The created ItemStack Snapshot
-