Skip to content
Flint
Documentation

menu

typePaper

A chest menu from the menus module. Slots are numbered from 0, left to right, top to bottom.

Properties 9

menu.title: text
read-onlyPaper

Title given when the menu was created.

menu.rows: number
read-onlyPaper

Number of rows.

menu.size: number
read-onlyPaper

Number of slots.

The underlying inventory.

menu.viewers: list
read-onlyPaper

Players who have this menu open.

menu.locked: bool
settablePaper

True (the default) stops players taking items out or putting items in.

Sound played when a button is clicked (none for silence).

menu.page: number
settablePaper

Current page of a paged menu, starting at 1. Assign to jump to a page.

Number of pages of a paged menu.

Methods 15

Puts a plain item in a slot (none empties it). Removes any button there.

The item in a slot, or none.

Puts a clickable item in a slot. The handler is called as handler(player, ...args, [click]); click is "left", "right", "shift_left"...

Fills every empty slot, e.g. menu.fill("gray_stained_glass_pane").

Puts an item in every slot on the edge of the menu.

Fills a whole row. Rows start at 1.

Fills a whole column. Columns go from 1 to 9.

Removes every item and button.

Shows a list of items over as many pages as needed, with previous/next buttons in the bottom row. The handler is called as handler(player, index, ...args, [click]); index starts at 0.

Calls handler(player, ...args) whenever the menu is opened with menu.open or player.open.

Calls handler(player, ...args) when a player closes the menu.

Opens the menu for a player.

Closes the menu for one player, or for everyone who has it open.