This project is a simple behavior pack for Minecraft bedrock dedicated servers that relay chat messages and join/leave messages from the game server to a chosen Discord channel.
This will built entirely under Minecraft Bedrock v1.20.15 for server software v1.20.15.01 and has not been tested with any other versions. This uses multiple beta APIs and therefore could easily break with future versions of the game. I will do my best to maintain this project but no assurances can be made.
First you need to create the Discord webhook that will be used by this project. There are many tutorials that already exist for creating Discord webhooks, so follow those instead as they are probably more up to date. However, make note of the webhook's URL. It will look something like https://discord.com/api/webhooks/123456790/abra_kadabra_alakazam and the important parts to note are the first set of numbers (which is the webhook's ID) and the following string of random characters (which is the webhook's token).
Next you will need to add this behavior pack to your server.
- Go to your
worldsfolder in your server files and locate your world. - Create a new subfolder inside your world folder called
behavior_packs(should sit alongside thedbfolder andlevel.dat). It might already exist. - Upload
bds-discord-relay.zipinto the newbehavior_packsfolder and extract it. - Now go back one folder until you see the
dbfolder, thebehavior_parksfolder, and thelevel.datfile once again. You need to upload a file calledworld_behavior_packs.json(or modify and merge the existing and provided files if one already exists). The resulting file should contain the following:
[
{
"pack_id" : "43163f81-c2a3-4b34-b6b0-2e709e1a6279", // will not change
"version" : [ 1, 0, 0 ] // subject to change as the pack updates
}
]- Go all the way back to the root directory of your server files. You should see a folder called
config. Copya12c3fc4-68dd-40c5-b57e-89429a7163d0.zipinto theconfigfolder and extract it. - Enter the new
a12c3fc4-68dd-40c5-b57e-89429a7163d0folder and modify thevariables.jsonfile. Here you will need to paste the webhook's ID and token that you got when creating the Discord webhook in the beginning. If done properly the file will look something like this:
{
"discord-webhook-id": "1234567890", // won't look exactly like this
"discord-webhook-token": "abra_kadabra_alakazam" // your ID and token will be different
}Congratulations, you've added the behavior pack and provided it the necessary permissions to operate. Now comes the complicated part. Currently Mojang provides no way for the bedrock dedicated server software to enable experiments, which currently is an issue as this pack requires experimental APIs. To accomplish this, I've found it easiest to modify the world using the PC verison of the game, but I suppose it could be possible with the mobile version as well.
- Copy the world from your server to your
minecraftWorldsfolder. This folder can usually be found at%localappdata%\Packages\Microsoft.MinecraftUWP_8wekyb3d8bbwe\LocalState\games\com.mojang. - Launch the game, locate the world you just uploaded, and click on the pencil (edit) icon.
- Scroll down until you see a category of game settings called "Experiments" and enable the one called "Beta APIs."
- Finally re-upload the world file back to the server. If this is your first time enabling experiments for the world it will create a copy of the world instead of modifying the existing one, so move over that copy instead.
I want to give a shoutout to the team at Lunar Eclipse Studios, whose Starlight Skin API is simply amazing and is used in this project to provide mugshots of the player's in-game skin when displaying chat messages on Discord's end. To say this would be a near impossible task to build from scratch all under the game's own limitations would be an understatement.
