Skip to content

ItemStack

Represents a stack of items.

item: Item

The item in the stack.

init(item: Item, count: Integer) -> ItemStack

Initializes ItemStack.

decrement(amount: Integer) -> Null

Decrements the amount of items in the stack by amount.

getCount() -> Integer

Returns the amount of items in the stack.

getDamage() -> Integer

Returns how the damage (lost durability) of the item stack.

Does NOT return how much damage the item does!

getHolder() -> Entity

Returns the entity who is holding the item.

getItem() -> Item

Returns the item in the stack.

getMaxCount() -> Integer

Returns the max amount of items that can be in 1 stack.

getMaxDamage() -> Integer

Returns the durability of the item.

getName() -> String

Returns the name of the item.

getRepairCost() -> Integer

Returns the repair cost of the item.

hasEnchantments() -> Boolean

Returns whether the item has enchantments.

increment(amount: Integer) -> Null

Increments the amount of items in the stack by amount.

isDamageable() -> Boolean

Returns whether the item is damageable.

isDamaged() -> Boolean

Returns whether the item is damaged.

isEnchantable() -> Boolean

Returns whether the item is enchantable.

isFood() -> Boolean

Returns whether the item is food.

isInFrame() -> Boolean

Returns whether the item is in a frame.

isStackable() -> Boolean

Returns whether the item is stackable.

setCount(amount: Integer) -> Null

Sets the amount of items in the stack to amount.

setDamage(damage: Integer) -> Null

Sets the damage (lost durability) of the item.

setRepairCost(repair_cost: Integer) -> Null

Sets the repair cost of the item.