KItem

interface KItem

Models an item in an KInventory

KItems do only work inside KInventories.

Author

Devin

Since

1.0.0

See also

Use the ItemManager to handle items

Items might be uniquely identified by having UUIDs, which can be implement using NBT Tags

KItems don't need to have IDs, which then removes the ability to listen to their click functions

Every implementation should inherit from this from the Bukkit ItemStack class to build a correct item

Inheritors

Properties

Link copied to clipboard

Determines the behaviour of the item when being dragged around the inventory

Link copied to clipboard

The parent inventory, the item is inside of

Link copied to clipboard
abstract var slot: Int

Slot of the item in the parent inventory, if the parent inventory is set

Functions

Link copied to clipboard
abstract fun draggable(): Boolean
Link copied to clipboard
abstract fun enchant(enchantment: Enchantment, level: Int)

Enchants this item with the given parameters

Link copied to clipboard
abstract fun setDisplayName(name: Component)

Sets the display name of the item

Link copied to clipboard
abstract fun setItemLore(lore: List<Component>)

Sets the lore of the item

Link copied to clipboard
abstract fun toItemStack(): ItemStack

Transforms the KItem to a Bukkit ItemStack