button

fun button(slot: Int, item: ItemStack, scope: EventScope<InventoryClickEvent>.() -> Unit = {}, metadata: Map<String, Any> = emptyMap(), delay: Long = 0, debounce: Long = 0, throttle: Long = 0, onClick: (InventoryClickEvent) -> Unit)

Registers a custom button in the GUI.

Parameters

slot

The slot in the GUI where the button will be placed.

item

The item to display on the button.

scope

The event scope to trigger the button's action.

metadata

Additional metadata associated with the button.

delay

The delay before the button's action is triggered.

debounce

The debounce time to prevent multiple clicks in quick succession.

throttle

The throttle time to limit button action triggers.

onClick

The action to be performed when the button is clicked.


fun button(slot: Int, builder: ButtonBuilder.() -> Unit)

Registers a button in the GUI using the ButtonBuilder DSL.

Parameters

slot

The slot in the GUI where the button will be placed.

builder

The builder function to configure the button's properties.


fun button(slot: Int, template: ButtonBuilder)

Registers a button in the GUI from a predefined ButtonBuilder template.

Parameters

slot

The slot in the GUI where the button will be placed.

template

The predefined template for the button.


fun button(slot: Int, template: ButtonBuilder, override: ButtonBuilder.() -> Unit)

Registers a button in the GUI by overriding properties of an existing ButtonBuilder template.

Parameters

slot

The slot in the GUI where the button will be placed.

template

The predefined template for the button.

override

The function to override specific properties of the button.