GUI menu system

Menu

Menu is a high-level inventory GUI system with click handlers. It wraps Inventory with per-slot click callbacks using MenuItem.


Constructor

Menu(title="", rows=3)

Create a menu.

shop = Menu("§6§lItem Shop", rows=3)

Attributes

title

Menu title.

rows

Number of rows.


Slot Access

Menu supports index-based access using [] notation.

Set a slot

menu[slot] = menu_item

Get a slot

item = menu[slot]

Delete a slot

del menu[slot]

Methods

fill_border

menu.fill_border(item)

Fill the border slots with a decorative item. This is synchronous.

shop = Menu("§6§lShop", rows=3)
shop.fill_border(Item("GRAY_STAINED_GLASS_PANE", name=" "))

open

menu.open(player)

Open this menu for a player. This is synchronous.

Tip: See MenuItem for click handler details and examples.