How do I link my Minecraft server to Discord with DiscordSRV?
In this article
DiscordSRV connects your Minecraft server's chat to a Discord channel: messages go both ways, and joins, leaves and death messages appear in Discord automatically. For an SMP or hardcore season it's the easiest way to keep the whole group involved in the game, even when they're not online.
Step 1: create a Discord bot
- Go to the Discord Developer Portal and create a new application.
- Open the Bot tab and copy the token. Don't share this token with anyone; whoever has it controls your bot.
- On the same tab, enable the Message Content Intent and the Server Members Intent. Without the first one the bot can't see any messages.
- Go to OAuth2, choose the
botscope with permissions to read and send messages, and open the generated link to invite the bot to your Discord server.
Step 2: install the plugin
Install DiscordSRV via your panel's plugin library or upload the jar file to plugins. See installing a plugin. Restart the server; the plugins/DiscordSRV folder appears with the configuration files.
Step 3: fill in the token and channel
Enable developer mode in Discord (Settings, Advanced) and right-click the chat channel to copy the channel ID. Open plugins/DiscordSRV/config.yml and fill in:
BotToken: "your-bot-token"
Channels: {"global": "123456789012345678"}Restart the server or type /discordsrv reload. The console shows whether the bot connects. Test it with a message in Minecraft: it should show up in Discord within a second, and the other way round.
Death messages and joins
Death messages and join and leave messages are on by default. If you want to change or disable them, open plugins/DiscordSRV/messages.yml. For a hardcore season it's fun to put death messages in a separate channel; add an extra channel to Channels and point to it in messages.yml.
Linking accounts (optional)
With /discord link a player gets a code to send to the bot. After that, DiscordSRV can for example automatically give a Discord role to players who are on the whitelist. For a friend group this isn't necessary.
Common problems
- The bot comes online but nothing happens: check the channel ID and whether the bot has permissions in that channel.
- Error about intents in the console: the Message Content Intent is switched off in the Developer Portal.
- Messages show up twice: another chat plugin is running that makes the same link; disable one of them.
- Token leaked: generate a new token in the Developer Portal and replace it in
config.yml.
Launch your server in 60 seconds on our own hardware.