-
Notifications
You must be signed in to change notification settings - Fork 0
UI System
DarkBladeDev edited this page May 10, 2026
·
1 revision
The MultiBlockEngine features a decoupled, reflection-safe UI system that allows creating dynamic menus and panels for your multiblocks with zero InventoryView versioning headaches across Minecraft versions.
- Version Independent: Works seamlessly from 1.19.4 to 1.21.1+.
- Dynamic Bindings: Link UI elements directly to multiblock variables or states.
- Async Rendering: Keeps the main thread smooth by calculating UI states asynchronously.
- Template Based: Define your UI layouts in YAML.
UI panels are typically defined in plugins/MultiBlockEngine/panels/:
id: simple_furnace_panel
title: "Furnace Status"
rows: 3
elements:
- slot: 13
material: BLAST_FURNACE
display_name: "&eMachine State: &f<state>"
lore:
- "&7Stored Energy: &a<variable:energy_stored>"
actions:
- type: "toggle_state"You can use dynamic placeholders in display_name and lore:
-
<state>: The currentACTIVE/INACTIVEstate. -
<variable:name>: The value of a multiblock variable. -
<metadata:key>: Any metadata attached to the instance.
You can open a panel via an action in your multiblock definition:
on_interact:
- type: open_panel
panel: "simple_furnace_panel"To register custom bindings or handle UI events in Java:
@InjectService
private PanelViewService uiService;
public void openCustomUI(Player player, MultiblockInstance instance) {
uiService.openPanel(player, "my_custom_id", instance);
}Addons can register custom data binders to provide even more dynamic data to the UI system.