Skip to main content

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​

TermMeaning
layoutPoolThe named layouts of the menu.
mainLayoutIdThe id of the layout drawn first (the root).
LayoutA rule that places slots: grid, rows, pages, scrolling area, frames or layers.
ItemOne slot description: item, name, lore, position, permissions and click actions.
InteractionWhat happens for one click type: commands, triggers, close or go back.
SessionThe state of an open menu for one player: history, current page, scroll position and active view.
ViewportThe part of a scrollable layout currently visible.

Build order​

  1. Create the Open GUI entry, then choose guiType, size and title.
  2. Add a simple layout with an id, and write that id in mainLayoutId.
  3. Add decorative items first (borders, backgrounds), then the buttons.
  4. Add interactionList entries to the buttons.
  5. Only then add frame, scrollable, paginated or views.

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​

  • criteria hides the slot for players who do not match.
  • viewPermission hides the slot for players without the permission.
  • clickPermission draws the slot but makes it inert.
  • allowPickup lets 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.
  • executeReturn on an interaction goes back to the previous menu of the session.
  • closeMenu on an interaction closes the window.
  • Closing with Escape ends the session.

Next steps​