Features
Commands from Discord
Run Minecraft commands on your server from Discord and decide who may send which commands.
/server-command run runs commands on your Minecraft server without RCON and without an open port. The command travels over the chat sync connection. Two places have a say: in Discord you decide who may send commands, and in the server's config you decide which commands it accepts.
Set up
- Connect the server as described under Chat sync.
- Set which commands the server accepts in the config. Out of the box it's only
whitelist add,whitelist removeandwhitelist list.
# Spigot, Paper, Folia: plugins/mc-sync/config.yml
commands:
mode: allow
allow:
- say
- kick
- lp user * parent add# Fabric, Quilt, Forge, NeoForge: config/mc-sync.properties
commands.mode=allow
commands.allow=say,kick,lp user * parent add- Run
/mcsync reload. On Forge before Minecraft 1.19, restart the server instead. - Allow commands for a role. Discord admins don't need this.
- In the dashboard, open "Permissions".
- Pick the role under "Allow commands for a role".
- Enter the command names under "Allowed commands", for example
say, kick. - Under "On which servers?", pick single servers or leave it empty for all.
- Click "Save".
- Run
/server-command permission add role: @Moderator commands: say,kick. - Check with
/server-command permission listwho may run what, and which server a command from this channel goes to.
- Send a command, without a leading slash:
/server-command run command: say Hello from DiscordOnly you see the reply. It names the server the command ran on and shows the output if the server returns any.
The command goes to the server you pick with server. Without it, the bot uses the server the channel belongs to (chat or whitelist), otherwise the only connected server. If several servers are connected and the channel belongs to none of them, nothing runs and the bot lists the channels where it's clear.
The dashboard has the console for this, with live output, buttons and schedules.
Settings
On the Minecraft server
| Key | Effect |
|---|---|
commands.mode | off: nothing. whitelist: only whitelist add, remove and list (default). allow: the whitelist plus commands.allow. all: every command. |
commands.allow | Extra commands for allow. An entry is matched word by word from the start of the command, anything may follow. * matches exactly one word. |
commands.consoleFallback | Spigot, Paper, Folia only. If a plugin command rejects output capture, true runs it once more without output. Default: false. |
whitelist add allows whitelist add Notch but not whitelist off. lp user * parent add allows granting a rank, not removing one. All three keys apply after /mcsync reload.
In Discord
| Who | May |
|---|---|
| Administrators of the Discord server | run any command the Minecraft server accepts, and grant commands |
| Roles with a grant | run the granted commands |
| Everyone else | nothing |
A grant covers the first word: whitelist allows every whitelist command the server accepts. * allows all. How far a command reaches is limited by commands.allow. Limiting a grant to single servers is only possible in the dashboard. /server-command permission remove role: @Moderator takes all grants from a role.
The bot logs every command it ran or rejected in a channel if you set one: /notices channel purpose: commands channel: #commands, or in the dashboard under "Notices & reports" → "Channels" → "Command log".
Problems
"You are not allowed to run this command"
Your role has no grant in Discord. The bot names the command an admin has to allow with /server-command permission add.
"The server does not allow this command"
The Minecraft server rejects it. Set commands.mode to allow, add the command under commands.allow and run /mcsync reload.
The bot doesn't know which server you mean
Pick the server with server: or send the command in that server's chat channel.
The reply has no output
Many commands only answer in the game or not at all. On Forge 1.8 to 1.12.2 the command runs, but no output comes back.
A plugin command says it doesn't support output capture
On Spigot, Paper or Folia, set commands.consoleFallback: true. The command then runs again on the real console, without output.
"The server did not answer"
The server wasn't connected or took too long. There's no way to tell whether the command ran anyway. Check in the game before you repeat it.