ButtonBuilder

A builder class for creating a GuiButton with various configuration options.

This class allows you to define the behavior, appearance, and additional properties of a button in a GUI. You can customize the button's item, click actions, animations, and other properties using this builder.

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
var animationFrames: List<ItemStack>

A list of item frames for animating the button.

Link copied to clipboard

The interval (in ticks) between animation frames.

Link copied to clipboard

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

Link copied to clipboard
var delay: Long

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

Link copied to clipboard
var item: ItemStack?

The item that represents the button.

Link copied to clipboard

The metadata associated with the button.

Link copied to clipboard
var onClick: (InventoryClickEvent) -> Unit?

The action to be performed when the button is clicked.

Link copied to clipboard
var scope: EventScope<InventoryClickEvent>.() -> Unit

The event scope that defines the conditions for this button's action to be triggered.

Link copied to clipboard

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

Functions

Link copied to clipboard

Builds the GuiButton with the defined properties.

Link copied to clipboard

Sets up a chain redirection from this button to another GUI builder when clicked.

Link copied to clipboard
fun frames(vararg frames: ItemStack): ButtonBuilder

Adds frames for animating the button.

Link copied to clipboard

Sets the interval (in ticks) between animation frames.

Link copied to clipboard

Sets up a redirection from this button to another GUI builder when clicked.

Link copied to clipboard

Sets up a redirection with metadata from this button to another GUI builder when clicked.