gui

fun gui(title: Component, rows: Int = 6, creator: GuiCreator.() -> Unit): Inventory

Creates a simple GUI (Inventory) using a DSL.

Example usage:

val inventory = gui(Component.text("Simple GUI"), 3) {
slot(SLOT_2_5) {
icon(Material.APPLE)
onClick { player.sendMessage("Clicked!") }
}
}
player.openInventory(inventory)

Return

A new Bukkit Inventory.

Parameters

title

The title of the GUI.

rows

The number of rows (1-6).

creator

The builder block.