Skip to content

GUI System

CoreLib provides GUI templates, open requests, session management, slot control, and click handling. Business modules reuse this infrastructure instead of implementing inventory events from scratch.

Used by

ModuleUsage
EmakiForgeForge GUI, recipe book, editor.
EmakiStrengthenStrengthening GUI, material slots, protection slots.
EmakiGemInlay, extraction, socket opening, and upgrade GUI.
EmakiSkillsSkill panel and trigger-selection GUI.
EmakiCookingSteamer, oven, juicer, and fermentation-barrel GUI.

Template fields

FieldTypeRequiredDescription
idstringYesTemplate id used by the module.
titlestring/objectYesInventory title. MiniMessage strings and TextConfig objects are supported.
rowsintegerYesInventory rows, usually 1 to 6.
slotsmapYesSlot definitions keyed by slot name.

Slot fields

FieldTypeDescription
keystringSlot key used by business code.
slotslist<number>Inventory indexes covered by this slot definition.
typestringBusiness type label, such as input, output, button, or decoration.
itemstring/objectCurrent recommended item-source field for the slot's base display item. The Web GUI editor writes structured item sources back to this field.
componentsobjectDisplay-name, lore, model, enchantment, and tooltip overrides.
soundsmapClick sounds keyed by click type.

Current field convention

  • New configs and the Web Console GUI editor use item for the slot base item source.
  • Old names such as item_source, item_sources, and material are not read or written by the current Web GUI editor as structured item-source aliases. If old YAML still contains them, treat them as legacy unknown fields and migrate manually.
  • Dynamic slots used for buttons, descriptions, empty states, previews, or confirmation items prefer template item, display_name, lore, and component settings. Business-code fallback displays are used only when the template does not configure them.
  • Real player-provided target items, materials, actual recipe results, and AIR-hidden slots remain controlled by business state and should not be overwritten by template display items.

Component fields

FieldDescription
display_nameItem display name. MiniMessage strings or TextConfig objects are supported.
loreLore lines. An empty list clears lore.
item_modelMinecraft 1.21+ item model key.
custom_model_dataLegacy custom model data integer.
enchantmentsEnchantment map or list.
hidden_componentsComponents hidden from tooltip display.
hide_tooltipHides the whole tooltip.

Editing advice

  1. Change display text first.
  2. Then move decorative slots.
  3. Adjust functional slots only after confirming the layout.
  4. Test shift-click, drag, double-click, close handling, and full-inventory cases after each GUI change.