Skip to content

UI System

DarkBladeDev edited this page May 10, 2026 · 1 revision

🖥️ UI System

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.

✨ Features

  • 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.

🧱 YAML Configuration

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"

Placeholders

You can use dynamic placeholders in display_name and lore:

  • <state>: The current ACTIVE/INACTIVE state.
  • <variable:name>: The value of a multiblock variable.
  • <metadata:key>: Any metadata attached to the instance.

🛠️ Opening a Panel

You can open a panel via an action in your multiblock definition:

on_interact:
  - type: open_panel
    panel: "simple_furnace_panel"

💻 Developer API

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);
}

Custom Bindings

Addons can register custom data binders to provide even more dynamic data to the UI system.

Clone this wiki locally