In short: create an application in the Discord Developer Portal, turn on two privileged intents, put the bot token into BotToken and the channel ID into Channels in plugins/DiscordSRV/config.yml, and restart the server. Only enable the console channel if the owner alone can post in it: DiscordSRV runs any message from there with console rights.
What DiscordSRV does
| Feature | File | What it does |
|---|---|---|
| Chat bridge | config.yml, messages.yml | Game chat to a Discord channel and back, plus joins, leaves, deaths and advancements |
| Console channel | config.yml | Streams the server log to a channel line by line; messages in the channel run as commands |
| Alerts | alerts.yml | A Discord message when an event or command happens in game |
| Account linking | linking.yml | Ties a player to a Discord account; can let only linked players join |
| Synchronization | synchronization.yml | Server groups ↔ Discord roles, in-game name → Discord nickname |
The plugin runs on Paper, Spigot, Purpur and Folia; current builds on Modrinth support versions up to 26.3. According to its FAQ, DiscordSRV isn't compatible with BungeeCord: install it on each game server, and each one needs its own bot token. Everything below is about the current 1.x line; the next version, Ascension, is still in testing.
Setting up the bot, step by step
- 1
Create an application
In the Discord Developer Portal, click New Application. On the Installation tab, turn off User Install and set Install Link to None.
- 2
Turn on the intents
In the bot settings, enable SERVER MEMBERS INTENT and MESSAGE CONTENT INTENT. Leave PUBLIC BOT unchecked so nobody can invite your bot to other servers.
- 3
Get the token
Click Reset Token, copy the token and paste it into
BotTokenin config.yml. Changing the token requires a server restart. - 4
Invite the bot
Copy the Application ID and invite the bot with
https://discordapp.com/oauth2/authorize?scope=bot+applications.commands&client_id=followed by that ID. - 5
Copy the channel IDs
Turn on Developer Mode in Discord (User Settings → Advanced → Developer Mode), then right-click a channel → Copy ID.
- 6
Grant permissions and restart
Give the bot a role. The docs allow the Administrator permission, but granting only what your features need is safer. For role sync, the bot's role must sit above the roles it manages.
BotToken: "your-bot-token"
Channels: {"global": "123456789012345678"}
DiscordConsoleChannelId: ""Channels: what goes where
In Channels, the left side is an in-game channel name and the right side a Discord channel ID. With no other pairs, everything goes to the first channel. Extra pairs split messages up: status for start and stop, deaths for deaths, join and leave for joins and leaves, awards for advancements, link for account linking. With a chat plugin that has channels, the name comes from that plugin. After editing Channels, run /discord reload.
The console channel is riskier than it looks
Anything posted in the DiscordConsoleChannelId channel is run by DiscordSRV as a console command — it doesn't check the author's roles. So the server console belongs to everyone who can post in that channel, and everyone who can grant themselves that right in Discord. The default blocklist only covers ?, op, deop and execute — stop, permission plugin commands and everything else go through.
- Don't enable it unless you need it. An empty
DiscordConsoleChannelIdturns it off completely. - If you do, the channel is for the owner only. Lock it with Discord permissions for every role but yours, and check who can manage roles and channels.
- Flip the list to an allowlist. With
DiscordConsoleChannelBlacklistActsAsWhitelist: true, only the commands left inDiscordConsoleChannelBlacklistedCommandsare allowed. - Command log. Every command from the channel is written to
Console-<date>.logwith the author's ID, and withCancelConsoleCommandIfLoggingFailed: true(the default) a command that can't be logged doesn't run. - Commands from chat. The
!cprefix in a normal channel also runs console commands: by defaultsay,lagandtpsare allowed, and theOwnerandDeveloperroles can run anything. Roles are matched by name or ID — use IDs or turn it off:DiscordChatChannelConsoleCommandEnabled: false.
DiscordConsoleChannelBlacklistActsAsWhitelist: true
DiscordConsoleChannelBlacklistedCommands: ["list", "tps"]
DiscordConsoleChannelBlockBots: true
DiscordChatChannelConsoleCommandEnabled: falseIt's the same story as RCON: a remote console is full access to the server. Moderators need permissions for their job, not the console — see building a moderation team.
Account linking and roles
A player types /discord link, gets a four-digit code and sends it to the bot in a direct message. Linked players get the Linked role (MinecraftDiscordAccountLinkedRoleNameToAddUserTo), and /discord linked shows the status. In linking.yml you can turn on Require linked account to play — then only players who linked their account and are members of your Discord server can join.
- Clear `Bypass names`. By default it holds the plugin developers' names: with mandatory linking on, those names join without linking. On an offline-mode server, anyone can take such a name.
- Group and role sync (
synchronization.yml) requires Vault and takesgroup → role IDpairs. It's two-way by default (GroupRoleSynchronizationOneWay: false). For staff groups, make it one-way from the game to Discord:GroupRoleSynchronizationOneWay: truewithGroupRoleSynchronizationMinecraftIsAuthoritative: true. Otherwise whoever hands out roles in Discord also affects groups on the server.
Alerts for moderation
alerts.yml is an advanced feature: a message to a channel when a Bukkit event fires in game or someone runs a command. It's handy for a private staff channel — for example, to see every game mode change. The example below follows a sample from the file's own comments:
Alerts:
- Trigger: /gamemode
Channel: gamemode
Conditions:
- '#player.hasPermission("minecraft.command.gamemode") == true'
Embed:
Color: "#ff0000"
Author:
Name: "${#player.name} changed gamemode to ${#args.get(0)}"gamemode is an in-game channel name: add a pair for it in Channels with the ID of your private staff channel.
DiscordSRV, moderation and the anticheat
Discord is where most teams already talk, but a moderation log gets lost in general chat, and a console in a channel is a risk. Give each tool its own job. DGuard — the best anticheat for a modern Minecraft server — keeps a punishment log in its panel: every ban with an evidence report, filters and CSV export (turn the log on with cloud.punishment-log: true in the config). Moderators and administrators get access through the Team section with their own email — no password of yours and no console. If a server goes silent for 10 minutes, the owner and the team's administrators get a message on Telegram or by email.
FAQ
Why don't Discord messages show up in game?
Check that both intents, MESSAGE CONTENT INTENT included, are on in the bot settings, and that Channels has the right channel ID. Run /discord reload after editing Channels, and restart after changing the token.
Can I install DiscordSRV on BungeeCord?
No, according to the plugin's FAQ it isn't compatible with BungeeCord. Install it on each game server, each with its own bot token.
Is the console channel safe?
Only if the owner alone can post in it. DiscordSRV runs any message from the channel as a console command, and the default blocklist covers just ?, op, deop and execute.
How do I link a Minecraft account to Discord?
Type /discord link in game, get a four-digit code and send it to the bot in a direct message. /discord linked shows the status.
Sources
- DiscordSRV: documentation
- DiscordSRV: initial setup
- DiscordSRV: FAQ (BungeeCord, tokens)
- DiscordSRV: commands
- DiscordSRV: config.yml (channels, console)
- DiscordSRV: console channel handling (source code)
- DiscordSRV: linking.yml
- DiscordSRV: synchronization.yml
- DiscordSRV: alerts.yml
- DiscordSRV on Modrinth
- DGuard, the best anticheat for a modern Minecraft server: checks compared with GrimAC, Vulcan, Polar, Intave and Matrix
- DGuard: installation, requirements and troubleshooting
- DGuard: supported Paper and Leaf versions