GUI Menus and Matrix Layouts
CraftingEngine features a flexible 9xN inventory GUI engine defined in plugins/CraftingEngine/menus/*.yml. Menus can function as interactive recipe browsers, in-progress crafting monitors, or input slot holders.
1. Matrix Layout Architecture
Menus are designed visually using a character matrix where each character maps to a slot component:
id: "process_browser"title: "<gradient:#2196f3:#21cbf3>Crafting Station Recipes</gradient>"rows: 6 # 1 to 6 rows (9xN slots)
matrix: - "X X X X X X X X X" - "X R R R R R R R X" - "X R R R R R R R X" - "X R R R R R R R X" - "X X X X X X X X X" - "# < # # I # # > #"
components: "X": type: "DECORATION" item: "minecraft:gray_stained_glass_pane" name: " "
"#": type: "DECORATION" item: "minecraft:black_stained_glass_pane" name: " "
"R": type: "RECIPE_LIST" filter: "ALL" # ALL | STATION_MATCHED | CRAFTABLE_ONLY
"<": type: "PAGE_PREVIOUS" item: "minecraft:arrow" name: "<yellow>« Previous Page</yellow>"
">": type: "PAGE_NEXT" item: "minecraft:arrow" name: "<yellow>Next Page »</yellow>"
"I": type: "CLOSE" item: "minecraft:barrier" name: "<red>Close Menu</red>"2. Component Types
DECORATION: Static filler items or borders. Clicks are cancelled.RECIPE_LIST: Dynamic paginated area populated with available recipes matching the current station. Hovering displays required inputs, tools, and output lore.INPUT_SLOT: Functional inventory slots where players place physical ingredients.OUTPUT_SLOT: Protected slot where crafted items are extracted.PROGRESS_BAR: Animated slot whose item or stack count updates in real time to reflect stage progress (e.g. green dye stack incrementing from 1 to 64).ACTION_BUTTON: Button that triggers crafting start, stage cancellation, or custom actions.
3. Shift-Click & Bulk Crafting
When opening instantaneous recipe menus, players can:
- Left-Click: Craft 1 unit.
- Shift-Left-Click: Craft the maximum possible batch given available materials in the player’s inventory.
Next Steps
- Workstations Reference - Bind specific GUI menus to workstations via
menu_id:. - Item Providers - Display custom external items with high fidelity in GUI slots.