Minecraft Plugin: Discord for Voice & Text Chat

It’d be cool to be able to voice chat to other players on the Minecraft server. There are a few ways to implement this, one of which involves setting up and connecting a Discord server.

The Discord server will be linked to the Minecraft server using the DiscordSRV plugin. Installation instructions for the plugin can be found here. These are the steps that I took to get it all working.

Prerequisites

You’ll need to be running a Minecraft Server fork (like Spigot or Paper) which enables plugins. See my Paper Minecraft Server installation post.

Create a Discord Server

What is Discord? I’m a Discord neophyte, it’s not an unreasonable question. Discord is a communication and collaboration platform designed primarily for gamers, but which has expanded to accommodate a wide array of other online communities. It offers voice, video and text chat options. Its low-latency voice chat is particularly popular for real-time communication during gaming sessions. Users can create their own servers (essentially private or public chat rooms), each with multiple channels dedicated to different topics or activities.

Go to Discord now.

Create an account if you don’t already have one. Then login.

We’re going to create a server for our Minecraft community. Hit the big green plus sign in the left-hand nav.

You can choose from a selection of templates (the Gaming template seems an obvious choice). However, this time we’re going to roll our own by selecting the Create My Own option.

Specify the purpose of the server. Either of the options offered might be valid IMHO. Choose whichever is most appropriate. You can also just skip this question, which suggests that it’s not particularly important.

Provide a suitably descriptive (or obscure) server name. Optionally upload an icon (you can grab a Minecraft icon here). Hit the big blue Create button.

You’ll be taken to the dashboard for the newly created server.

Enable Developer Mode

We’re going to be connecting the Discord server to Minecraft and will need to access IDs for various Discord components. These are not available by default but are enabled in developer mode. Go to the user settings (the cog at the bottom near to your username). Under the Advanced tab enable Developer Mode.

Create a Bot

We’re going to create a bot to manage the connection between Discord and Minecraft. Go to the Discord Developers Portal.

Press the big blue New Application button.

Provide a name for the bot and press the blue Create button.

Go to the Bot tab under Settings.

Hit the Reset Token button then copy the token.

While you’re here you can also toggle off the Public Bot option.

Scroll down and enable both Server Members Intent and Message Content Intent.

DiscordSRV Plugin

We’re going to use the DiscordSRV Plugin to link up our Minecraft and Discord servers. Download the latest version of the plugin onto the server.

wget https://get.discordsrv.com/ -O DiscordSRV.jar

Move the .jar file into the plugins/ directory on your server.

Restart the Minecraft server process. This will unpack the plugin .jar file into the plugins/DiscordSRV/ directory.

Find and edit the config.yml file. Insert the token for your Discord bot.

BotToken: "MTE5MDk_EXAMPLE_MzU5NDY1Ng.GdMHun.VB5u_EXAMPLE_zKWGINwmrRj_XRZn2fgFhrAdk"

Once again restart the Minecraft server. This time there will be a message warning you that the bot has not been added to a Discord server. This will be followed by an URL. Copy the URL.

Alternatively, go to the OAuth2 tab under Settings in the Discord Developers Portal, check the bot option. Then scroll to the bottom of the page and copy the URL.

Open the URL in a browser.

Select the server to which you want to add the bot. Press the big blue Continue button.

Press the big blue Authorize button.

Restart the Minecraft server. This time there should not be any errors or warnings (well, at least none related to the DiscordSRV plugin).

Linking Text Channel

Right-click on a text channel on the Discord server. At the bottom of the resulting popup menu you should find an option to copy the channel ID. If you don’t see this option then you need to go back and enable Developer Mode.

Insert the channel ID into the DiscordSRV config.yml configuration file too.

Channels: {"global": "1190925769954735186"}

Create another channel, #console, on the Discord server. Add the associated channel ID to the configuration file.

DiscordConsoleChannelId: "1190953097074251059"

Tweak a few other settings:

Experiment_WebhookChatMessageDelivery: true
Experiment_WebhookChatMessageUsernameFromDiscord: true
Experiment_WebhookChatMessageAvatarFromDiscord: true

Either manually restart the Minecraft server or issue the discord reload server command.

Linking Voice Channel

Enable voice via the voice.yml configuration file in the plugins/DiscordSRV directory.

Voice enabled: true

Copy the ID for the voice channels category. Insert it into voice.yml.

Voice category: 1190915859954735185

Copy the ID for a voice channel. Insert it into voice.yml.

Lobby channel: 1190915759964735187 

Restart the Minecraft server or reload the DiscordSRV configuration.

Voice chat is triggered by proximity: you can chat to those players who are close to you in the game. The settings for this can also be found in voice.yml. This will launch a separate voice channel on Discord which you can use to chat to other nearby players.

Network:
  Vertical Strength: 40
  Horizontal Strength: 80
  Falloff: 5
  Channels are visible: false 

For proximity to work you need to link Minecraft players to Discord accounts.

💡 When using Discord for voice chat the actual chat is happening via Discord and not Minecraft. So you still need to run a Discord client (either in your browser or as a standalone client).

Player Linking

Edit the linking.yml configuration file.

Require linked account to play:
  Enabled: true 

This will force players to link their Discord account to their Minecraft account before they can play on the server. When a player tries to connect they will see a message like this:

They’ll need to login to the Discord server and then send a message to the bot with the specified text.

The link will be established immediately.

FAQ

Q. Do I need to restart the Minecraft server when I change DiscordSRV configuration options?
A. No, you can just reload the configuration with discord reload.

Conclusion

There’s quite a lot of setup required, but linking your Minecraft and Discord servers will enable voice chat (and enhanced text chat), which will dramatically improve the gaming experience on your server.