Skip to content
Flint
Dokumentation

menu

typePaper

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

Egenskaber 9

menu.title: text
skrivebeskyttetPaper

Title given when the menu was created.

menu.rows: number
skrivebeskyttetPaper

Number of rows.

menu.size: number
skrivebeskyttetPaper

Number of slots.

menu.inventory: inventory
skrivebeskyttetPaper

The underlying inventory.

menu.viewers: list
skrivebeskyttetPaper

Players who have this menu open.

menu.locked: bool
kan ændresPaper

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

menu.click_sound: text
kan ændresPaper

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

menu.page: number
kan ændresPaper

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

menu.page_count: number
skrivebeskyttetPaper

Number of pages of a paged menu.

Metoder 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.