Understand a GUI menu
An Open GUI entry carries everything a menu needs: the window type, the title, a pool of layouts and the options of the session. This page explains the vocabulary and the order in which to build a menu.
Vocabulary
| Term | Meaning |
|---|---|
layoutPool | The named layouts of the menu. |
mainLayoutId | The id of the layout drawn first (the root). |
| Layout | A rule that places slots: grid, rows, pages, scrolling area, frames or layers. |
| Item | One slot description: item, name, lore, position, permissions and click actions. |
| Interaction | What happens for one click type: commands, triggers, close or go back. |
| Session | The state of an open menu for one player: history, current page, scroll position and active view. |
| Viewport | The part of a scrollable layout currently visible. |
Build order
- Create the Open GUI entry, then choose
guiType,sizeandtitle. - Add a
simplelayout with anid, and write thatidinmainLayoutId. - Add decorative items first (borders, backgrounds), then the buttons.
- Add
interactionListentries to the buttons. - Only then add
frame,scrollable,paginatedorviews.
Slot repetition
count, direction, gap and repeatY repeat an item. A single item with count 9 and direction right fills a row. These fields place slots; they never change the stack size of the item. gap is a step: 1 places adjacent slots and 2 leaves one empty slot between copies. Without a direction, the three fields are ignored and one slot is placed.
Slots that would land outside the grid are dropped and listed in the console with the layout id and the coordinates.
Visibility and clicks
criteriahides the slot for players who do not match.viewPermissionhides the slot for players without the permission.clickPermissiondraws the slot but makes it inert.allowPickuplets the player take the item out of the menu; it is off by default.
All of them are optional, and a blank permission gates nothing.
Open, back and close
- Any entry that can trigger an action can fire the Open GUI.
executeReturnon an interaction goes back to the previous menu of the session.closeMenuon an interaction closes the window.- Closing with Escape ends the session.