Skip to content

Commands

All commands are executed server-side. By default they require operator level ≥ 2, but each command has its own permission node — so plugins like LuckPerms can grant access without giving OP.

Open a full-screen GUI

bash
/webgui gui <targets> <url>

Opens a full-screen browser window for the specified players. The player closes it with Esc.

Examples:

bash
/webgui gui @p https://your-spa.example.com
/webgui gui @a https://your-spa.example.com

Open a HUD overlay

bash
/webgui hud <targets> <url>

Opens a transparent browser overlay on top of the game view. The player can toggle interactive mode with the HUD key (default `).

Example:

bash
/webgui hud @p https://your-spa.example.com

Bind a GUI to an entity

bash
/webgui bind entity <selector> <url>
/webgui bind entity <selector> <url> <cancel_interaction>

Attaches a WebGUI URL to one or more entities. When a player right-clicks a bound entity, the GUI opens automatically.

ArgumentTypeDescription
<selector>EntityArgumentType.entities()Any entity selector: UUID, @e[type=...], etc.
<url>StringURL to open. Supports placeholders.
<cancel_interaction>Boolean (default false)If true, the vanilla interaction is suppressed (e.g. villager trade screen won't open).

Examples:

bash
# Bind the nearest villager — trade screen still opens alongside the GUI
/webgui bind entity @e[type=villager,limit=1,sort=nearest] https://example.com/shop

# Bind with cancel — only the WebGUI opens, no trade screen
/webgui bind entity @e[type=villager,limit=1,sort=nearest] https://example.com/shop true

# URL with entity placeholder
/webgui bind entity @e[type=villager,limit=1,sort=nearest] "https://example.com/shop?npc={entity_id}"

Bindings are persisted to config/webgui/entity_bindings.json and survive server restarts.

URL placeholders

PlaceholderValue
{entity_id}Entity UUID
{entity_uuid}Entity UUID (alias)
{entity_type}Namespaced type, e.g. minecraft:villager
{player_name}The interacting player's display name
{player_uuid}The interacting player's UUID

Remove an entity binding

bash
/webgui unbind entity <selector>

Removes the WebGUI binding from the matched entities. Right-clicking them reverts to vanilla behaviour.

bash
/webgui unbind entity @e[type=villager,limit=1,sort=nearest]

Reload config

bash
/webgui reload

Re-reads config/webgui/server.json and config/webgui/entity_bindings.json from disk without restarting the server. Все поля (autoHudUrl, mainMenuUrl, enableTokens, tokenTtlSeconds и др.) применяются немедленно — следующий игрок, который зайдёт или получит команду, увидит новые настройки.

If the file is missing or contains an error the command prints the reason and leaves the current settings unchanged.

Argument types

ArgumentType
<targets>EntityArgumentType.players() — supports selectors like @p, @a
<url>Greedy string — the full URL, may contain spaces
<selector> (bind/unbind)EntityArgumentType.entities() — any entity selector
<url> (bind)String — supports {entity_id}, {player_name}, and other placeholders

Permissions

Permission nodeDefaultDescription
webgui.commandOP 2Access to the /webgui root command
webgui.command.guiOP 2Run /webgui gui
webgui.command.hudOP 2Run /webgui hud

The mod uses fabric-permissions-api, which LuckPerms, LibertyBans, and most other Fabric permission plugins hook into automatically.

LuckPerms example

bash
# Grant a group the right to open GUIs for players
/lp group moderator permission set webgui.command.gui true
/lp group moderator permission set webgui.command.hud true

# Or grant everything under /webgui at once
/lp group admin permission set webgui.command true