DiscordGate
Require Discord account linking before players can join. Integrates with BaxiBot
DiscordGate
DiscordGate
Gate your Minecraft server behind Discord. Only linked players can join.
Integrates directly with BaxiBot. No extra website, no extra setup.
- - -
How it works
1. A player tries to join your server 2. They get kicked with a short code 3. They type `/mc link <code>` in your Discord server 4. BaxiBot verifies the code and whitelists them 5. They can now join permanently
- - -
Features
- Velocity support: unlinked players can't join, period - Velocity support: configure everything from the Baxi dashboard - Velocity support: Floodgate UUIDs work out of the box - Velocity support: `/dg` to check status or get a new code, `/dgunlink` to unlink - Velocity support: greets players on first join after linking, showing their Discord name - Velocity support: each Discord server manages its own MC server independently - Velocity support: optionally post a message when someone links - Velocity support: assign a role on link, remove it on unlink - Velocity support: optionally notify the user when linking succeeds - Velocity support: choose whether players can unlink themselves or require admin action - Velocity support: two-way chat bridge using linked identities — MC players post in Discord under their own Discord display name + avatar (via webhook, with `· MC` suffix), Discord messages from linked users show in-game as `[DC] <mc_name> (<discord_name>): …`. Unlinked Discord users are dropped silently. Configure the bridge channel + webhook in the BaxiBot dashboard. - Velocity support: standalone proxy plugin — own storage + HTTP API, no Paper backend needed
- - -
Commands
In-game
|Command |Permission |Description | |------------------------------------|----------------------|-------------------------------------| |`/dg` |`dg.use` (default: all)|Show link status / get your link code| |`/dg unlink` |`dg.use` (default: all)|Unlink your Discord account | |`/dg announce <message>` |`dg.admin` (default: op)|Broadcast in-game only | |`/dg announce --discord <message>` |`dg.admin` (default: op)|Broadcast in-game and to Discord | |`/dg reload` |`dg.admin` (default: op)|Reload config.yml | |`/dg lock` |`dg.admin` (default: op)|Block new account links | |`/dg unlock` |`dg.admin` (default: op)|Allow new account links | |`/dg admin link <player> <discord_id>`|`dg.admin` (default: op)|Manually link a player | |`/dg admin unlink <player>` |`dg.admin` (default: op)|Manually unlink a player |
Alias: `/dglink`
Discord (via BaxiBot)
|Command |Description | |-----------------------|-----------------------------------------------------------| |`/mc link <code>` |Link your Minecraft account | |`/mc unlink` |Unlink your account | |`/mc status` |Show your linked account | |`/mc admin unlink <user>`|Force-unlink a Discord user (requires Manage Server) | |`/mc admin lookup <user>`|Look up a user's linked MC account (requires Manage Server)|
- - -
Setup
Paper (standalone or backend)
1. Drop `DiscordGate-{version}-1.21.jar` into your `plugins/` folder and start the server. 2. Edit `plugins/DiscordGate/config.yml`:
```yaml port: 4321 bind-address: "0.0.0.0" # use 127.0.0.1 if BaxiBot and Velocity run on the same machine secret: "your-secret-here" ``` 3. Make sure port `4321` is reachable from the machine running BaxiBot (and Velocity, if used).
BaxiBot Dashboard
1. Open the MC Link for your server 2. Go to MC Link 3. Enter your server's API URL (e.g. `http://your-server-ip:4321`) and secret 4. Enable and save
Velocity (standalone — recommended for networks)
The Velocity plugin is fully standalone: it manages its own storage and runs its own HTTP API. BaxiBot connects directly to Velocity — no Paper plugin needed on backend servers.
``` [ BaxiBot ] ──→ [ Velocity :4321 ] ──→ [ Survival backend ]
(API + storage) ──→ [ Creative backend ]
(gates players) ──→ [ Hub backend ]
``` 1. Drop `DiscordGate-velocity-{version}.jar` into your Velocity `plugins/` folder. 2. Start Velocity once. A config file is generated at `plugins/discordgate/config.properties`. 3. Edit the config:
```properties
HTTP API port — point BaxiBot at this server's IP and this port
port=4321 bind-address=0.0.0.0
Shared secret — enter this same value in the BaxiBot dashboard
secret=your-secret-here
Kick message shown to unlinked players ({token} = link code)
kick-message=<red><bold>Discord account not linked!</bold></red>n<gray>Join our Discord and type:</gray>n<gold><bold>/mc link {token}</bold></gold>n<dark_gray>This code expires in 10 minutes.</dark_gray>
token-ttl-minutes=10 ``` 4. Restart Velocity. 5. In the BaxiBot dashboard, set the API URL to ` http://your-velocity-ip:4321` (not your Paper backend).
> Backend servers: disable the vanilla whitelist (`white-list=false` in ` > server.properties`) on all backends — Velocity is the gate. Backends should not > be directly reachable from the internet.
Cross-chat in a Velocity network
Cross-chat needs both the Velocity plugin and the Paper plugin installed. The two plugins handle different directions:
- BaxiBot is captured by the BaxiBot plugin on each backend (via `AsyncChatEvent`). Each backend POSTs the message directly to BaxiBot's ` /dg/chat-out`. Velocity's `PlayerChatEvent` is unreliable on signed chat (1.19.1+), so Velocity stays silent on outbound. - BaxiBot is delivered by BaxiBot to a single URL — pointed at Velocity. Velocity then broadcasts the message to every player on every backend in one call. No per-backend fan-out, no Paper involvement on this path.
This means the shared secret must match across all three places: every Paper backend's `secret`, the Velocity `secret`, and the BaxiBot dashboard's API secret. BaxiBot uses that secret to authenticate inbound POSTs from any Paper backend, and to authorise its own outbound POSTs to Velocity.
##### Step-by-step setup
Assumed prerequisite: regular DiscordGate is already working (players can `/mc link` and join). You're only adding chat now.
1. Create a Discord webhook for the bridge channel
In Discord:
- Open the channel you want to use as the chat bridge → Copy Webhook URL → Copy Webhook URL → Copy Webhook URL → Copy Webhook URL. - Name it whatever you like (it gets overridden per-message anyway). Click Copy Webhook URL — you'll paste this into the BaxiBot dashboard in step 4.
2. Configure every Paper backend
For *each* backend server, edit `plugins/DiscordGate/config.yml`:
```yaml
Already present from the basic setup — leave as-is:
secret: "your-shared-secret" bot-api-url: "https://baxi.avocloud.net" # or your self-hosted BaxiBot URL
New cross-chat keys:
chat-bridge-enabled: true chat-relay-source: "paper" # this backend captures chat for relay chat-format-dc-to-mc: "<gray>[DC]</gray> <white>{mc_name}</white> <dark_gray>({discord_name})</dark_gray><gray>:</gray> <white>{message}</white>" ``` Then run `/dg reload` in-game (or restart the backend). Repeat on every backend.
3. Configure the Velocity proxy
Edit `plugins/discordgate/config.properties` on the proxy:
```properties
Already present:
secret=your-shared-secret
New cross-chat keys:
chat-bridge-enabled=true chat-relay-source=paper chat-format-dc-to-mc=<gray>[DC]</gray> <white>{mc_name}</white> <dark_gray>({discord_name})</dark_gray><gray>:</gray> <white>{message}</white> ``` `chat-relay-source=paper` here is critical: it tells the Velocity plugin not to also relay outbound chat. Without it every MC message would be sent to Discord twice (once by Paper, once by Velocity).
Restart Velocity.
4. Configure the BaxiBot dashboard
Open the Baxi dashboard → MC Link for the right Discord server.
Confirm the existing fields:
- API Secret points at API Secret (e.g. `http://your-velocity-ip:4321`), not at any Paper backend. This is what Velocity-network setups already require — it's how inbound messages reach all backends in one call. - API Secret matches the value you put in Paper + Velocity configs.
Scroll to the new Cross-chat section:
- Toggle Save on. - Pick the Save from the dropdown. - Paste the Save you copied in step 1. - Click Save.
##### Verification
1. Join the network and type `hello` in chat. Within ~1s a webhook message should appear in the bridge channel under your Discord display name + ` · MC (<your-mc-name>)` suffix. 2. From Discord, post `hi` in the bridge channel. Every player on every backend should see `[DC] <your-mc-name> (<your-discord-name>): hi`. 3. Post in the channel from a Discord account that is not linked. Nothing should appear in MC (silent drop is by design).
##### Troubleshooting
- Webhook posts as "Wumpus" / generic name — check the Paper backend log for `[dg chat-out] Bot responded …`. If you see a 401, secrets don't match. If there's no log line at all, `chat-bridge-enabled` is false or the player isn't linked. Unlinked players are not relayed. - Webhook posts as "Wumpus" / generic name — check Velocity's log for any `/dg/chat-in` request line. If BaxiBot's API URL still points at a Paper backend, the inbound POST goes to that backend and only its players see it. Repoint the dashboard's API URL at Velocity. - Webhook posts as "Wumpus" / generic name — Velocity is also relaying. Set ` chat-relay-source=paper` in `config.properties` and restart. - Webhook posts as "Wumpus" / generic name — the linked Discord user is no longer in the guild (BaxiBot can't fetch their member object). The fallback uses the MC name. Re-invite them or unlink/relink.
- - -
Requirements
- Paper 1.21.1+ or Velocity 3.3+ (with Paper 1.21.1+ backend) - or added to your Discord server
- - -
config.yml (Paper)
```yaml port: 4321 bind-address: "0.0.0.0" secret: "CHANGE-ME"
kick-message: | <red><bold>Discord account not linked!</bold></red> <newline> <gray>Join our Discord and type:</gray> <newline> <gold><bold>/mc link {code}</bold></gold> <newline> <dark_gray>This code expires in 10 minutes.</dark_gray>
token-ttl-minutes: 10
welcome-message-enabled: true welcome-message: "<green>Welcome, <white><bold>{player}</bold></white>! Your Discord account <aqua>{discord_name}</aqua> is linked."
allow-self-unlink: true
── Cross-chat (MC ↔ Discord) ─────────────────────────────────────────────
chat-bridge-enabled: true
Which side captures MC chat to forward to Discord — only relevant when both
the Paper plugin AND the Velocity plugin are deployed in the same network.
One of: "paper", "velocity".
chat-relay-source: "paper"
MiniMessage template for Discord→MC. Tokens: {mc_name} {discord_name} {message}
Token values are escaped before substitution so Discord users can't inject tags.
chat-format-dc-to-mc: "<gray>[DC]</gray> <white>{mc_name}</white> <dark_gray>({discord_name})</dark_gray><gray>:</gray> <white>{message}</white>" ``` All messages support MiniMessage formatting.
The bridge channel and webhook URL are set per-Discord-server in the BaxiBot dashboard → MC Link → Cross-chat section.