Online Editor

LuckPerms-style web editor hosted by mineCodes with live apply over WebSocket.

Overview

mineHud ships with an online editor (tree/form editor, visual canvas, YAML IO). The plugin does not host the website. The UI and session relay are hosted by mineCodes (or your own Docker stack). The plugin only:

  1. Creates a session and uploads a config snapshot
  2. Keeps an outbound WebSocket open for apply events
  3. Writes the applied config and reloads the HUD

Flow

/minehud editor
    β”‚
    β”œβ”€ POST session snapshot ──► relay (HTTP)
    β”œβ”€ outbound WebSocket   ──► relay (WS)
    └─ chat link            ──► https://hud.mncd.pl/?session=...&secret=...

Browser editor
    β”œβ”€ GET session YAML
    β”œβ”€ WS role=editor
    └─ Save ── apply event ──► plugin applies config + reload

Plugin Configuration

editor-bridge:
  enabled: true
  editor-base-url: "https://hud.mncd.pl"
  api-base-url: "https://hud.mncd.pl/api"
  ws-base-url: "wss://hud.mncd.pl/api"
  timeout-seconds: 15
OptionDescription
enabledWhen false, /minehud editor reports the editor as disabled
editor-base-urlBrowser UI origin (no trailing slash)
api-base-urlRelay HTTP API base
ws-base-urlRelay WebSocket base (wss:// in production behind TLS)
timeout-secondsHTTP timeout for session create/upload

Usage

  1. Ensure editor-bridge.enabled is true and URLs are correct
  2. Run /minehud editor (permission minehud.command.editor)
  3. Open the link from chat
  4. Edit panels in the tree/form UI or on the canvas
  5. Click Zapisz na serwerze β€” the plugin receives the apply event and reloads

The editor shows a pack-impact badge when changes require a full resource pack regeneration.

Production (mineCodes)

Default URLs point at the hosted stack:

ServiceURL
Editor UIhttps://hud.mncd.pl
API (HTTP)https://hud.mncd.pl/api
API (WebSocket)wss://hud.mncd.pl/api

No extra plugin setup is required beyond a working network path from the game server to the relay.

Self-hosted Docker

From the mineHud repository root:

docker compose up -d --build    # local: http://localhost:8080

Production images (Artifact Registry):

docker compose -f docker-compose.prod.yml pull
docker compose -f docker-compose.prod.yml up -d

nginx in the editor image:

  • Serves the SPA from /
  • Proxies /api/* to the relay (including WebSocket)

Put the stack behind a TLS reverse proxy (e.g. hud.mncd.pl β†’ host WEB_PORT).

Plugin config for Docker on the same host:

editor-bridge:
  enabled: true
  editor-base-url: "http://127.0.0.1:8080"
  api-base-url: "http://127.0.0.1:8080/api"
  ws-base-url: "ws://127.0.0.1:8080/api"

Local Development

Terminal 1 β€” relay:

cd editor/relay
npm install
npm start
# http://127.0.0.1:18927

Verify:

curl -i http://127.0.0.1:18927/health
# response should include header: X-MineHud-Relay: minehud-relay

Terminal 2 β€” SPA:

cd editor
npm install
npm run dev

Plugin config:

editor-bridge:
  enabled: true
  editor-base-url: "http://127.0.0.1:5173"
  api-base-url: "http://127.0.0.1:18927"
  ws-base-url: "ws://127.0.0.1:18927"

Preview Coordinate Model

The canvas matches the in-game 480Γ—270 GUI model:

  • Text top edge β‰ˆ anchorY + pixelY
  • Line left edge β‰ˆ anchorX + pixelX - 1 (boss-bar advance correction)
  • Background is drawn slightly above the text (padding-aware)

Use the editor Debug checkbox and /minehud debug in-game to compare pixel metrics.

Troubleshooting

IssueWhat to check
β€œEditor disabled”editor-bridge.enabled: true
Open failed / timeoutapi-base-url reachable from the game server; relay running
Link opens but save does nothingWebSocket URL (ws-base-url / wss:// behind TLS); plugin still online
Wrong preview vs gameCompare /minehud debug with editor Debug overlay
Port already in use locallyFree 18927 / 5173 / 8080 or change ports

Server logs include details when session creation fails.