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
| Module | Usage |
|---|---|
| EmakiForge | Forge GUI, recipe book, editor. |
| EmakiStrengthen | Strengthening GUI, material slots, protection slots. |
| EmakiGem | Inlay, extraction, socket opening, and upgrade GUI. |
| EmakiSkills | Skill panel and trigger-selection GUI. |
| EmakiCooking | Steamer, oven, juicer, and fermentation-barrel GUI. |
Template fields
| Field | Type | Required | Description |
|---|---|---|---|
id | string | Yes | Template id used by the module. |
title | string/object | Yes | Inventory title. MiniMessage strings and TextConfig objects are supported. |
rows | integer | Yes | Inventory rows, usually 1 to 6. |
slots | map | Yes | Slot definitions keyed by slot name. |
Slot fields
| Field | Type | Description |
|---|---|---|
key | string | Slot key used by business code. |
slots | list<number> | Inventory indexes covered by this slot definition. |
type | string | Business type label, such as input, output, button, or decoration. |
item | string/object | Current recommended item-source field for the slot's base display item. The Web GUI editor writes structured item sources back to this field. |
components | object | Display-name, lore, model, enchantment, and tooltip overrides. |
sounds | map | Click sounds keyed by click type. |
Current field convention
- New configs and the Web Console GUI editor use
itemfor the slot base item source. - Old names such as
item_source,item_sources, andmaterialare 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
| Field | Description |
|---|---|
display_name | Item display name. MiniMessage strings or TextConfig objects are supported. |
lore | Lore lines. An empty list clears lore. |
item_model | Minecraft 1.21+ item model key. |
custom_model_data | Legacy custom model data integer. |
enchantments | Enchantment map or list. |
hidden_components | Components hidden from tooltip display. |
hide_tooltip | Hides the whole tooltip. |
Editing advice
- Change display text first.
- Then move decorative slots.
- Adjust functional slots only after confirming the layout.
- Test shift-click, drag, double-click, close handling, and full-inventory cases after each GUI change.