Skip to content

GUI

Forge GUI files live in gui/ and include the main forge GUI and the recipe book. The GUI protects input slots, handles clicks, returns items, and starts the forge process.

Files

FilePurpose
forge_gui.ymlMain forging interface.
recipe_book.ymlRecipe book listing loaded recipes.

Template structure

Templates use the CoreLib GUI template format. Top-level fields:

FieldTypeDescription
idstringTemplate id, matching the file name.
gui_typestringContainer type. The forge interface uses CHEST.
titlestringGUI title. Supports MiniMessage and the %recipe% replacement.
rowsintegerRow count. The bundled forge_gui uses 5 rows and recipe_book uses 6.
slotsmapSlot group definitions, keyed by group name.
virtual_itemsmapDynamic display items that do not occupy a slot.
textsmapStatus text fragments.

Each slot group contains:

FieldTypeDescription
slotslist<integer>Inventory slot indices used by this group.
typestringFunctional type. Omit it for a decorative slot.
itemobjectDefault display item (source plus components).
soundsobjectClick sound and related settings.

Forge interface slot types

Functional slot types driven by type in forge_gui.yml:

typePurpose
blueprint_inputsBlueprint input slots. Forge matches the recipe by the blueprint item source.
required_materialsRequired material input slots.
optional_materialsOptional material input slots, which consume forge capacity.
capacity_displayDisplays current capacity, capacity limit, and capacity state.
confirmConfirm button that starts forging.

Slot groups without a type (top_frame, side_frame, and core_frame in the bundled template) are decorative filler only.

Recipe book slot types

Functional slot types driven by type in recipe_book.yml:

typePurpose
recipe_listRecipe entry display area.
prev_pagePrevious page.
next_pageNext page.
closeClose the menu.

Slot group example

yaml
  blueprint_inputs:
    slots:
      - 10
      - 19
    type: "blueprint_inputs"
    item:
      source: "guster_banner_pattern"
      components:
        custom_name: "<light_purple>Insert Blueprint</light_purple>"
        lore:
          - "<gray>The recipe is matched by blueprint item source"

Confirm button example

yaml
  confirm:
    slots:
      - 34
    type: "confirm"
    item:
      source: "ANVIL"
      components:
        custom_name: "<green>Confirm Forging</green>"
        lore:
          - "<gray>Capacity: <yellow>%current%/%max%</yellow>"
          - "<yellow>Click to start forging"
    sounds:
      click:
        sound: "ui.button.click"
        volume: 1.0
        pitch: 1.0

Capacity display variables

Available in the lore of the capacity_display and confirm slots:

VariableDescription
%current%Currently used capacity.
%max%Capacity limit.
%capacity_state%Capacity state text, resolved from texts.capacity_state.

texts.capacity_state supports four state keys: waiting (awaiting blueprint), overflow (over limit), warning (near limit), and normal.

Virtual items

virtual_items.confirm_blocked defines the display item that replaces the confirm button when capacity is exceeded:

yaml
virtual_items:
  confirm_blocked:
    item:
      source: "BARRIER"
      components:
        custom_name: "<red>Cannot Forge</red>"
        lore:
          - "<gray>Capacity: <yellow>%current%/%max%</yellow></gray>"
          - "<red>Optional material capacity exceeded</red>"

Player experience tips

  • Spell out what each slot accepts in the default display item lore of the blueprint and material slots.
  • Use texts.capacity_state to clearly separate awaiting-blueprint, near-limit, and over-limit states.
  • When capacity is exceeded, confirm_blocked replaces the confirm button; state the fix directly in its lore.
  • Decorative slot groups separate functional areas. When adjusting the layout, avoid colliding with functional slot indices.