GuiButton

constructor(item: ItemStack, onClick: (InventoryClickEvent) -> Unit, scope: EventScope<InventoryClickEvent> = EventScope(), metadata: MutableMap<String, Any> = mutableMapOf(), delay: Long = 0, debounce: Long = 0, throttle: Long = 0, animationFrames: List<ItemStack> = emptyList(), animationInterval: Long = 20)

Parameters

item

The item that represents the button in the inventory.

onClick

The action that will be triggered when the button is clicked.

scope

The event scope that controls the conditions under which the button's action is triggered.

metadata

The metadata associated with the button.

delay

The delay (in ticks) before the button's action is triggered.

debounce

The debounce time (in ticks) to prevent multiple clicks in quick succession.

throttle

The throttle time (in milliseconds) to limit how frequently the button's action can be triggered.

animationFrames

A list of item frames for animating the button.

animationInterval

The interval (in ticks) between animation frames.