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

  1. Connect the server as described under Chat sync.
  2. Set which commands the server accepts in the config. Out of the box it's only whitelist add, whitelist remove and whitelist list.
yaml
# Spigot, Paper, Folia: plugins/mc-sync/config.yml
commands:
  mode: allow
  allow:
    - say
    - kick
    - lp user * parent add
properties
# Fabric, Quilt, Forge, NeoForge: config/mc-sync.properties
commands.mode=allow
commands.allow=say,kick,lp user * parent add
  1. Run /mcsync reload. On Forge before Minecraft 1.19, restart the server instead.
  2. Allow commands for a role. Discord admins don't need this.
  1. In the dashboard, open "Permissions".
  2. Pick the role under "Allow commands for a role".
  3. Enter the command names under "Allowed commands", for example say, kick.
  4. Under "On which servers?", pick single servers or leave it empty for all.
  5. Click "Save".
  1. Send a command, without a leading slash:
/server-command run command: say Hello from Discord

Only 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

KeyEffect
commands.modeoff: nothing. whitelist: only whitelist add, remove and list (default). allow: the whitelist plus commands.allow. all: every command.
commands.allowExtra commands for allow. An entry is matched word by word from the start of the command, anything may follow. * matches exactly one word.
commands.consoleFallbackSpigot, 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

WhoMay
Administrators of the Discord serverrun any command the Minecraft server accepts, and grant commands
Roles with a grantrun the granted commands
Everyone elsenothing

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.