Menus and own commands
Module menus. Settings files: menus.toml (enabled, clickSound), menus/, commands.toml
(enabled), commands.json.
Commands
| Command | What it does | Permission | Default |
|---|---|---|---|
/menu <name> | Open a menu from config/britaessentials/menus/ | brita.essentials.menus, plus the menu's own permission | everyone |
| own commands | Commands you define in commands.json | the command's own permission | everyone |
/brita reload | Reload menus, own commands and texts | operator | operators |
Menus
Each file config/britaessentials/menus/<name>.json is a chest menu, opened with /menu <name>. On the first
start the mod writes two examples, example and tips. The warps, homes and player warps menus are menu
files too. How to write one: Menu files.
Own commands
commands.json defines commands such as /discord or /hub. Each command does a list of
menu actions in order: [player] command, [console] command,
[message] text, [menu] name, [close]. On the first start the mod writes an example with /discord
(also /dc) and /whois. After changing the file run /brita reload: the new commands work at once, also
in tab completion.
{"commands": {
"example": {"aliases": ["ex"], "actions": ["[menu] example"]},
"hub": {"description": "Sends you to the lobby.", "permission": "brita.cmd.hub",
"usage": "<world>", "actions": ["[console] execute in {0} run tp {player} 0 80 0"]}
}}
| Option | What it does |
|---|---|
actions | What the command does, in order (required) |
permission | Only players with this permission see and use the command; empty for everyone |
aliases | More names for the same command |
description | Shown, with usage, when a player leaves out needed words |
usage | The words after the command, such as <nickname>; default <1> <2> |
- Names and aliases use
a-z,0-9,-and_. A name that another command (of Minecraft or any mod) already has is never replaced: it is skipped and reported in the server log. {player}is the player's name;{0},{1}and so on are the words typed after the command. A command using{1}asks for two words.- Words used in
[player]or[console]may hold only letters, numbers and_ - . : # +, so nobody can slip selectors such as@ainto a console command. In[message]any word works. - A command taken out of the file disappears after
/brita reload. Its name stays reserved until the server restarts, so another mod cannot take it over in between. permissionworks like in menu files: LuckPerms decides, otherwise only operators have it. Players see a permission change in their tab completion after rejoining or/brita reload.- With the economy module, a command can cost money: add its name under
costsineconomy.json.