🌉 How to set up Cantilever ​
Cantilever is Spirit Studios' simple-to-use Minecraft ↔ Discord bridge. This guide covers how to install it on a Minecraft server.
1. Preparation ​
With a fully set up Fabric Minecraft server (or equivalent) on a compatible version, download the latest version of Cantilever. Make sure to also download a compatible version of Fabric API.
2. Configuration ​
Put the downloaded JAR in your server mods
directory and cycle a launch. The server should log an error (or safely crash on earlier versions) if not configured.
Here's an example of a Cantilever configuration file. It can always be accessed from
<SERVER ROOT>/config/cantilever.json
.
{
"token": <YOUR BOT TOKEN>,
// You can get this value by enabling developer mode in discord and right clicking the channel you wish to use as your bridge.
"channelId": <CHANNEL ID>,
// Use %s in your value to slot in the game event text being sent.
"gameEventFormat": "**%s**",
// Use a first %s in your value to slot in a username, and a second to slot in the chat message content.
"gameChatFormat": "<@%s> %s",
// Use a %s slot to set the player UUID for your head service of choice!
"webhookFaceApi": "https://vzge.me/face/256/%s.png",
// The delay for sending a message from Discord to Minecraft in milliseconds. Set up to make sure that Webhook related Discord Bots such as PluralKit and Tupperbox may send messages from users..
"d2mMessageDelay": 0,
// Discord Webhooks to attempt to not send any original messages from. 'Original messages' are classified as being posted from a user before a webhook is sent and having matching content within the message. (Will only function when d2mMessageDelay has been set).
"webhooksForRemoval": {
"webhookIds": [],
"inverted": true
},
// The amount of messages after the initial message to search through to find a webhooksForRemoval webhook. (Will only function when d2mMessageDelay has been set).
"webhookMessagesToCheck": 3,
"statusMessage": "",
// Options: [playing, streaming, listening, watching, competing]
"activityType": "playing"
}
If this looks daunting, don't worry. The only values that should be of importance are token
and channelId
.
3. Let's make a bot! ​
Go to discord.dev and navigate to the Applications tab in the sidebar. Create a bot and stylise it to your liking! Once there, copy the token into your configuration. It should look like a random string of characters.
After putting the token in your configuration under token
, (the token lets Cantilever talk to Discord) scroll down to the PRIVILEGED GATEWAY INTENTS
section of the page. Make sure that MESSAGE CONTENT INTENT
is switched on.
Next, go to the Discord channel you want to use as your bridge chat. With developer mode enabled, right click the channel and click Copy Channel ID
. Put this in the channelId
part of the configuration file.
WARNING
Make sure not to EVER share your bot token with anyone. It provides unrestricted access to your bot unless reset.
4. Finishing touches ​
Next, grab your APPLICATION ID
from the General Information
tab. For convenience, we have a little tool to make adding a Cantilever bot to your server a little easier:
Alternatively, you can add the bot to the server by:
- Going to cantilever.spiritstudios.dev and using your
APPLICATION ID
- Navigating to
https://discord.com/oauth2/authorize?scope=bot+applications.commands&permissions=536938496&client_id=<YOUR APPLICATION ID>
Once the bot is in your server, make sure it has the following role permissions:
- Send Messages
- Read Message History
- Manage Webhooks
After finishing all of that, start up your server one last time and you should have a working bridge between Minecraft and Discord. Enjoy!