Skip to main content

Overview

The GUI extension provides a modular layout system for creating inventory menus. Instead of manually placing items at fixed slots, you define a tree of layouts that the engine assembles at runtime. Layouts nest like Russian dolls — a ScrollableLayout wraps a SimpleLayout, a CompositeLayout combines multiple children, etc.

Core Concepts

ConceptDescription
MenuDefinitionThe complete GUI definition: type (CHEST, ANVIL…), title, size, root layout, audio
MenuLayoutAbstract node in the layout tree — produces GuiSlot items for a viewport
layoutPoolJSON array of named layouts, referenced by mainLayoutId
mainLayoutIdID of the root layout to display
ViewportVisible area (default 9×6 for a double chest). Scrollable layouts have larger virtual sizes

Architecture