KtInventoryStorable

Represents a storable component of a KtInventory that manages inventory slots and their interactions.

Since

2.0.0

Types

Link copied to clipboard
class ClickEvent(event: InventoryClickEvent)

Wrapper class for inventory click events.

Link copied to clipboard
class DragEvent(event: InventoryDragEvent)

Wrapper class for inventory drag events.

Link copied to clipboard

Represents the result of handling an inventory event.

Properties

Link copied to clipboard

The parent KtInventory instance

Link copied to clipboard

Callback invoked when slots are clicked

Link copied to clipboard

Callback invoked when items are dragged

Link copied to clipboard

Callback invoked before click events to determine if action should proceed

Link copied to clipboard

Callback invoked before drag events to determine if action should proceed

Link copied to clipboard
val slots: List<Int>

List of slot indices managed by this component

Functions

Link copied to clipboard
fun clear()

Clears all items from managed slots.

Link copied to clipboard
fun contains(slot: Int): Boolean

Checks if this component manages the specified slot.

Link copied to clipboard
fun get(): List<@Nullable ItemStack?>

Gets all items from managed slots.

Link copied to clipboard
fun save()

Saves the current state of items in managed slots.

Link copied to clipboard
fun update(items: List<ItemStack?>): List<ItemStack?>

Updates the items in managed slots with the provided list of items.