跳到主要内容

Category Menu

Category Menu Configuration

Configures the menu for a specific quest category via declarative layout pools. Place a "SORT_SLOT" placeholder in your layout pool to have the sort button automatically injected at that position with per-mode display customization.

字段

字段类型默认值描述
categoryString—Category this menu configuration applies to. Leave empty for main menu.
titleString—Menu title shown to the player. Supports MiniMessage and PlaceholderAPI.占位符颜色
rowsInt4Number of inventory rows (3-6).
menuRef<OpenGuiActionEntry>—GUI entry providing the layout pool, main layout, type and audio configuration.
sortDisplayList<SortDisplayConfig>emptyPer-mode display overrides for the sort button. Define one entry per sort mode.
SortDisplayConfig(4)
字段类型默认值描述
modeSortModeConfigALLSort mode this display applies to.可选值:ALLNOT_STARTEDACTIVECOMPLETED
itemItem?—Item shown when this sort mode is active.
labelString—Label shown when this sort mode is active. Supports MiniMessage.占位符颜色
loreList<String>emptyAdditional lore lines. Supports MiniMessage and PlaceholderAPI.占位符颜色
viewsList<MenuViewData>emptyAddressable screens of this menu.
defaultViewIdString?—View opened first. Empty = the first declared view.
breadcrumbSeparatorStringDEFAULT_BREADCRUMB_SEPARATORMiniMessage separator inserted between breadcrumb segments by the {breadcrumb} title token.颜色
baseMenuIdString—Shared OpenGui chassis whose layout pool and views are inherited before this menu's own values.
pushHistoryOnViewSwitchBooleanfalsePush the previous view onto history when switching tabs.
TypeWriter 通用字段(criteria, modifiers, triggers)
字段类型默认值描述
criteriaList<Criteria>empty—
modifiersList<Modifier>empty—
triggersList<Ref<TriggerableEntry>>empty—

How to use it​

A Category Menu is the entry that opens a codex screen, and it can also be fired as an action from a quest, an NPC or a button. What it opens depends on category:

categoryOpensMarker the layout needs
emptyThe main menu, listing root categoriesCATEGORY_SLOT
a category nameThe quests of that categoryQUEST_SLOT
@trackedThe quests the player tracksTRACKED_QUEST_SLOT

menu references an Open GUI that is used only for its layoutPool, mainLayoutId, guiType and audio. Markers are items with buttonPrefix codex_button: and buttonType set to the marker, placed in simple layouts of that Open GUI.

  • rows must equal the height of the Open GUI, otherwise slots below the smaller height are dropped.
  • sortDisplay customizes the sort button, one element per mode (ALL, NOT_STARTED, ACTIVE, COMPLETED) with its own item, label and lore.
  • baseMenuId, views, defaultViewId, breadcrumbSeparator and pushHistoryOnViewSwitch turn the menu into a tab of a shared chassis, as in Views, tabs and inheritance. Keep the markers in the layouts of the Open GUI named by menu, not in the shared chassis.

The console lists every menu that cannot draw at startup, with the fix. See Building Codex menus.