button

fun button(vararg slot: Int, itemStack: ItemStack, onClick: (KtInventoryButton.ClickEvent<AbstractKtInventory>) -> Unit = {})

Adds a button to multiple slots with the given item and click handler

Since

2.0.0

Parameters

slot

Slot numbers to place the button

itemStack

Item to display

onClick

Click event handler


fun button(slot: Int, itemStack: ItemStack, onClick: (KtInventoryButton.ClickEvent<AbstractKtInventory>) -> Unit = {})

Adds a button to a single slot with the given item and click handler

Since

2.0.0

Parameters

slot

Slot number to place the button

itemStack

Item to display

onClick

Click event handler


fun button(slots: Iterable<Int>, itemStack: ItemStack, onClick: (KtInventoryButton.ClickEvent<AbstractKtInventory>) -> Unit = {})

Adds a button to multiple slots with the given item and click handler

Since

2.0.0

Parameters

slots

Slot numbers to place the button

itemStack

Item to display

onClick

Click event handler


Adds an existing button to a single slot

Since

2.0.0

Parameters

slot

Slot number to place the button

item

Button to add

Throws

if slot is not between 0 and size


fun button(vararg slot: Int, item: KtInventoryButton<KtInventoryBase>)

Adds an existing button to multiple slots

Since

2.0.0

Parameters

slot

Slot numbers to place the button

item

Button to add


Adds an existing button to multiple slots

Since

2.0.0

Parameters

slots

Slot numbers to place the button

item

Button to add