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
/webgui gui <targets> <url>Opens a full-screen browser window for the specified players. The player closes it with Esc.
Examples:
/webgui gui @p https://your-spa.example.com
/webgui gui @a https://your-spa.example.comOpen a HUD overlay
/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:
/webgui hud @p https://your-spa.example.comBind a GUI to an entity
/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.
| Argument | Type | Description |
|---|---|---|
<selector> | EntityArgumentType.entities() | Any entity selector: UUID, @e[type=...], etc. |
<url> | String | URL 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:
# 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
| Placeholder | Value |
|---|---|
{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
/webgui unbind entity <selector>Removes the WebGUI binding from the matched entities. Right-clicking them reverts to vanilla behaviour.
/webgui unbind entity @e[type=villager,limit=1,sort=nearest]Reload config
/webgui reloadRe-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
| Argument | Type |
|---|---|
<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 node | Default | Description |
|---|---|---|
webgui.command | OP 2 | Access to the /webgui root command |
webgui.command.gui | OP 2 | Run /webgui gui |
webgui.command.hud | OP 2 | Run /webgui hud |
The mod uses fabric-permissions-api, which LuckPerms, LibertyBans, and most other Fabric permission plugins hook into automatically.
LuckPerms example
# 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