Commands
Custom commands
modules/custom-commands.yml is where /discord, /rules and the rest of your server's own
commands go.
enabled: true
custom:
discord:
description: Shows the Discord invite.
permission: ''
aliases: [ dc ]
cooldown-seconds: 0
messages:
- '%prefix%<gray>Come talk to us:'
- '<dark_gray> ▪ <aqua><underlined>discord.gg/yourserver'
run-as-player: [ ]
run-as-console: [ ]
sound:
key: ui.button.click
volume: 0.5
pitch: 1.4| Key | What it does |
|---|---|
description |
Shown in /help. |
permission |
Who may use it. Empty means everyone. |
aliases |
Extra names for it. These live here, not in aliases.yml. |
cooldown-seconds |
How long before the same player may repeat it. chorus.bypass.cooldown ignores it. |
messages |
Lines sent to whoever ran it, in MiniMessage. %prefix% and %player% both work. |
run-as-player |
Commands run as the player, with their permissions. |
run-as-console |
Commands run as the console, with full permissions. |
sound |
Played to the player who ran it. |
permission-message |
What somebody without the permission is told. |
requires |
What has to be true first, as on any command. |
on-success |
Actions once it has run. |
on-fail |
Actions when it is refused: no permission, a requirement or the cooldown. |
log |
true writes every use into the staff log. |
The last five work exactly as they do on any other command — see Per-command rules for the requirement and action types.
custom:
vote:
description: Thanks you for voting.
messages:
- '%prefix%<gray>Thanks for voting!'
requires:
- 'playtime: 600'
on-success:
- 'console: eco give %player% 100'
- 'title: <gold>Thanks!;<gray>+100 coins'
log: trueA command with no messages and nothing to run is skipped with a warning, since it would do
nothing at all. One whose only effect is an on-success action counts as doing something.
run-as-console#
This is the useful one, and the one to be careful with. It lets a player trigger something they have no permission to do themselves.
daily:
description: The daily reward.
permission: ''
cooldown-seconds: 86400
messages:
- '%prefix%<gray>Here you go.'
run-as-console:
- 'give %player% diamond 3'Treat it as you would treat op. A cooldown on a command that runs as console is the only thing between it and being run a thousand times.
%player% is the name of whoever ran the command.
A command cannot call itself. Listing /daily among the run-as-console lines of
daily is refused with a message rather than run, because the only thing it can do is call
itself until the server stops answering.
Adding one needs a restart#
Adding, renaming or removing a custom command, or changing its aliases, needs a server restart, because the name has to be registered with Bukkit before anything can call it.
Editing what an existing one says or does is picked up by /chorus reload.
Examples#
A plain information command:
website:
description: Shows the website.
permission: ''
aliases: [ web ]
cooldown-seconds: 5
messages:
- '%prefix%<gray>Find us at <aqua><underlined>example.com'
run-as-player: [ ]
run-as-console: [ ]
sound:
key: ui.button.click
volume: 0.5
pitch: 1.2A staff-only shortcut that chains real commands:
cleanup:
description: Clears the ground and reports.
permission: chorus.admin
cooldown-seconds: 30
messages:
- '%prefix%<gray>Sweeping.'
run-as-player:
- 'sweep drops'
- 'tps'
run-as-console: [ ]A rank shop button, for a plugin that has no command of its own:
claimvip:
description: Claims VIP after buying it.
permission: server.boughtvip
cooldown-seconds: 0
messages:
- '%prefix%<gold>Welcome to VIP.'
run-as-console:
- 'lp user %player% parent add vip'What it is not#
There is no condition, no requirement and no menu here. A command that needs any of those is a kit — see Kits, which has requirements, claim actions and fail actions, all of which take console commands too.
