Designing the menus
Dungeon has two menus, and you draw both. This page builds a minimal pair: a browser with two dungeon slots, and a lobby with ready, leave and auto-fill buttons. It assumes you already created a Dungeon Instance and a Dungeon Category as in the Getting started steps.
New to GUI layouts? Read the GUI introduction and the layouts guide first. The menus below use the same layoutPool and mainLayoutId fields as the Open GUI action.
The global menu
- On a sequence page, add a Dungeon Global Menu and set
categoryto your category. SetinventoryRowsto3andinventoryTitleto<gold>Dungeons. - In
layoutPool, add a layout of typesimplewith theidmain. TypemaininmainLayoutId. - In
items, add a border: a gray stained glass pane atx0,y0, withcount9,directionrightand a single space asdisplayName. Repeat aty2. - Add an item with
buttonTypeDUNGEON_INSTANCE_SLOTatx3,y1,count3,directionright,gap1. Its material does not matter: it is a marker. The first three dungeons of the category fill the three positions. - Optionally add an item with
buttonTypeDUNGEON_FIND_PARTYatx8,y1(for example a compass named<yellow>Find a party), and one withbuttonTypeDUNGEON_INFOfor a help book. - Trigger the entry from an NPC dialogue option or a command event, then Publish.
What each dungeon looks like is set in the category, not in the layout: open the Dungeon Category and edit unlockedItem, unlockedName and unlockLore of its slot. {dungeon_name}, {players} and {max} are replaced when the menu opens and whenever it repaints. To lock a dungeon for some players, add criteria to its slot: they see the locked look and cannot open it.
The party menu
- Add one Dungeon Party Menu. Leave its
dungeonInstanceempty to serve every dungeon, or name a dungeon to give it its own menu. A menu with an emptydungeonInstanceserves the dungeons no other menu names. - Set
inventoryRowsto3andinventoryTitleto<gold>Lobbies. - Choose the lobby look:
lobbyItem(a paper by default),lobbyNameLobby {index}and alobbyLoresuch as{players}/{max} playersand{player_names}. - In
layoutPool, add asimplelayoutmainand setmainLayoutId. Place an item withbuttonTypeDUNGEON_LOBBY_SLOTwhere lobbies should appear (usecount,directionandgapfor a row). Without a marker, lobbies are drawn from the top-left corner, andlobbyOffsetXandlobbyOffsetYmove them away from your border or buttons. - Add three button items in the bottom row:
DUNGEON_READY(for example a lime dye named<green>Ready),DUNGEON_LEAVE(a barrier) andDUNGEON_AUTO_FILL. - Publish. Do not trigger this entry yourself: it opens when a player clicks a dungeon in the global menu.
A dungeon has one lobby per maxSimultaneousInstances, so a dungeon with maxSimultaneousInstances 1 shows a single lobby.
What a player experiences
- The player opens the global menu and clicks a dungeon. The party menu opens.
- They click a lobby to join it. With MMOCore, Parties or the Typewriter party extension installed, the whole party of a player joins the lobby together when there is room (Dungeon only reads those parties and never changes them).
- Other players see the new member without clicking: both menus refresh by themselves (
autoRefreshTicks). Each player presses the ready button. When everyone is ready andminPartySizeis reached, thestartCooldownSecondscountdown runs, then the party is teleported to the spawn point. - When the run ends, players come back to where they were.
Tips
Draw the layout in a plain Open GUI menu with decorative items, check the positions, then copy the layoutPool into the Dungeon menu and tag the dynamic items.
buttonType must be written in capitals as listed in Menus. A misspelled type is not an error: the item stays a normal item and does nothing special.