Two-factor authentication for Minecraft via Discord. Lets players link their Minecraft account to Discord enabling two-factor authentication through Discord. Supports both game servers (Paper, Spigot) and proxies (BungeeCord, Velocity).
-
Linking
- Player joins your Discord server and clicks the “Link” button in the configured channel.
- They receive a one-time code in DMs.
- In-game they run
/link <code>to complete the link.
-
Verification
- If you use “remember sign-in location,” the plugin tracks IP and client version.
- When a linked player joins from a new location, they get a Discord DM with “Verify” / “Deny.”
- Until they verify, they are restricted by
allowedCommandsandallowedActions.
-
Proxy
- On BungeeCord/Velocity, the same link/verify flow runs on the proxy; you can optionally send unverified players to a specific backend and move them after verification.
| Platform | Module | Notes |
|---|---|---|
| Paper | paper |
1.16.5+ |
| Spigot | spigot |
1.20.5+ |
| BungeeCord | bungeecord |
Proxy; optional verification/post-verification servers |
| Velocity | velocity |
Proxy; same options as BungeeCord |
Use the JAR that matches your platform (e.g. discord2fa-paper-2.0.0.jar for Paper).
- Download the right JAR from Releases or Modrinth.
- Game servers (Paper/Spigot): Put the JAR in
plugins/. - Proxies (BungeeCord/Velocity): Put the JAR in the proxy’s
plugins/folder. - Start the server once to generate
config.ymland thelang/folder. - Edit
config.yml: set database (or leave SQLite default) and Discord bot (token, guild ID, channel ID). - Restart the server.
The Discord bot will only start when discord.token, discord.guild, and discord.channel are set. Until then, the plugin will run but log that the bot is not configured.
Config lives in the plugin folder as config.yml. Key sections:
- type:
sqlite(default),mysql,mariadb, orpostgresql - url: Leave empty for SQLite to use
discord2fa.dbin the plugin folder. For MySQL/MariaDB/PostgreSQL, set the JDBC URL. - Paper/Spigot: MySQL/MariaDB/PostgreSQL drivers are loaded automatically via
plugin.ymllibraries. - BungeeCord/Velocity: For MySQL/MariaDB/PostgreSQL, add the matching JDBC driver JAR to the proxy’s classpath (e.g. plugin folder or
lib/).
- token — Bot token from the Discord Developer Portal.
- guild — Discord server (guild) ID.
- channel — Channel ID where the “Link your account” message and button appear.
The bot creates one link message in that channel and reuses it after restarts.
- language — Language code for messages (e.g.
en,de). Files inlang/can be edited. - allowedCommands — Commands players can run before verifying (e.g.
/link). - allowedActions — What unverified players can do:
CHAT,MOVE,BREAK,PLACE, etc. - forceLink — If
true, every player must link before playing. - rememberSignInLocation — If
true, players are only asked to verify when they join from a new IP/version; known locations are trusted for 30 days.
- server.verification — Optional backend server name where unverified players are sent.
- server.post-verification — Optional server to send players to after they verify.
Important: The proxy only sees connection, chat, and commands. It does not see in-game events (block break/place, movement, etc.). To keep unverified players from breaking or building on your verification server, secure that server with a protection plugin (e.g. WorldGuard or similar) so the verification server is a restricted area—no build/destroy, or a small safe lobby—instead of relying on Discord2FA on every backend.
| Command | Description | Permission |
|---|---|---|
/link <code> |
Link account using the code from Discord. | discord2fa.link |
/unlink |
Unlink Discord (only if already verified). | discord2fa.unlink |
/discord2fa or /d2fa |
Admin info and status. | discord2fa.admin |
/discord2fa version— Shows current plugin version and whether a newer release or an experimental build is running./discord2fa status— Shows whether the database and Discord bot are running, with short reasons if something failed (e.g. bot not configured).
Discord2FA uses grant-by-default permissions for link/unlink and op-only for admin:
| Permission | Default | Description |
|---|---|---|
discord2fa.link |
true | Use /link. |
discord2fa.unlink |
true | Use /unlink. |
discord2fa.admin |
op | Use /discord2fa (version, status). |
Grant by default vs revoke by default
discord2fa.linkanddiscord2fa.unlinkare granted by default (Paper/Spigot:default: true). Everyone can use/linkand/unlinkunless you explicitly revoke the permission (e.g. in LuckPerms:lp user <player> permission set discord2fa.link false).discord2fa.adminis op by default; you grant it (or give op) to allow use of the admin command.
On BungeeCord and Velocity, the same permission nodes are checked in code. Configure your permission plugin so that the default group grants discord2fa.link and discord2fa.unlink (or use a wildcard); revoke them for specific users/groups to deny link/unlink.
All other behavior is controlled by config (e.g. who must link, which commands are allowed before verification).
Requirements: Java 16+, Maven 3.6+
git clone https://github.com/sieadev/Discord2FA.git
cd Discord2FA
mvn package -DskipTestsOutput JARs (with version in the name, e.g. 2.0.0):
paper/target/discord2fa-paper-2.0.0.jarspigot/target/discord2fa-spigot-2.0.0.jarbungeecord/target/discord2fa-bungeecord-2.0.0.jarvelocity/target/discord2fa-velocity-2.0.0.jar
Version is set in the root pom.xml via <revision> and is used for all modules.
Discord2FA/
├── common/ # Shared logic: database, Discord bot, config, i18n
├── gameserver/ # Game-server core (used by Paper & Spigot)
├── proxyserver/ # Proxy core (used by BungeeCord & Velocity)
├── paper/ # Paper plugin
├── spigot/ # Spigot plugin
├── bungeecord/ # BungeeCord plugin
├── velocity/ # Velocity plugin
└── pom.xml # Parent POM (revision, dependency management, shade config)
- common — Database (HikariCP, SQLite/MySQL/MariaDB/PostgreSQL), Discord (Javacord), config adapters, messages.
- gameserver / proxyserver — Extend
BaseServerand add platform-agnostic player handling; platforms wrap these and register commands/listeners.
- Fork the repo and create a branch.
- Make changes; keep formatting and style consistent with the existing code.
- Run
mvn compile(and tests if you add or change any). - Open a pull request with a short description of the change.
MIT. See LICENSE in the repository.
Author: sieadev · Mail · Contact@siea.dev