Skip to content

Minecraft Spigot plugin (1.16.5 - 1.21) that allows you to authenticate players using Discord bot!

License

Notifications You must be signed in to change notification settings

MrQuackDuck/DiscordVerificator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

14 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

DiscordVerificator

DiscordVerificator is a Spigot plugin that allows you to do player authentication using Discord bot.

Warning

This plugin is intended to be used on private servers with the manual player addition because it involves you to manually link each player to their Discord profile.

It was developed as an alternative for password-based authorization like /login <password> on servers with online-mode set to false (in server.properties).

πŸ€” How it works?

This plugin enables players to link their usernames to their Discord profiles.

The linking process is controlled by the administrator of the server.
In order to link the account, the admin should run /link <Player> <Discord ID>. (how to get discord id?)

Then, when a player joins the server, the verification code appears.
To join the server, the player should run the seen command to the Discord bot you've configured:


Note

Verification is required once per IP change

Caution

The plugin will prevent a player from joining if it wasn't linked to Discord profile yet:

πŸ’» Commands

  • /link <player> <discordId> β€” links the player to its Discord profile. (how to get discord id?)
  • /unlink <player> β€” unlinks the player from its Discord profile.
  • /dvreload β€” reloads the plugin (including Discord bot).

πŸ”ž Permissions

  • discordVerificator.link (for operators by default) β€” Allows to use /link <player> <discordId>
  • discordVerificator.unlink (for operators by default) β€” Allows to use /unlink <player>
  • discordVerificator.reload (for operators by default) β€” Allows to use /dvreload

πŸ“„ Default config

Important

You should replace DISCORD_BOT_TOKEN with your Discord bot token.
Otherwise, nothing will work!

# 1. Create discord bot on discord developer portal: https://discord.com/developers/applications
# 2. Get token from "Bot" tab
# 3. Insert the token below
# 4. Run "/dvreload" command or reload the server
# 5. Give your players access to send a command to the bot (e.g: invite it to your Discord server)
token: "DISCORD_BOT_TOKEN"

messages:
  "not-enough-permissions": "&cNot enough permissions!"
  "invalid-link-format": "&cInvalid format! Please use: /link <player> <discordId>"
  "invalid-unlink-format": "&cInvalid format! Please use: /unlink <player>"
  "invalid-user-id-format": "&cInvalid Discord ID format!"
  "successfully-linked": "&aSuccessfully linked!"
  "successfully-unlinked": "&aSuccessfully unlinked!"
  "player-already-linked": "&cThis player was already linked!"
  "player-was-not-linked": "&cThis player was never linked!"
  "account-not-linked": "&cYour account is not linked to Discord profile yet."
  "bot-not-working": "&cDiscord bot is not currently working!\nAsk the administrator to resolve this issue."
  "confirm-with-command": "&6Confirm your IP via our Discord bot\nUsage: &f&n/confirm %s"
  "wait-until-verification": "&cPlease wait until you can have a new code!\n&f&n%s seconds left."
  "error-occurred": "Error occurred!"
  "its-not-your-account": "Account you're trying to confirm is not linked to your Discord profile"
  "allowed": "Allowed!"
  "allowed-to-join-from-ip": "Successfully allowed to join from `%s`!"
  "confirm-command": "Command to verify you on Minecraft server"
  "verification-code-you-got": "Verification code you've got from the server"
  "invalid-code": "Invalid Code!"
  "invalid-code-description": "This verification code is not valid!"
  "invalid-usage": "Invalid usage!"
  "provide-code-please": "Provide verification code, please!"
  "user-not-found": "User wasn't found!"
  "user-not-found-description": "It seems like your account wasn't yet linked to any Minecraft username"
  "reloaded": "&#14C60D[DiscordVerificator] Reloaded!"

β˜‚ Getting started

Important

Before getting started, make sure that the plugin's version is compatible with your server version.

  1. Create a new discord application on Discord Developer Portal
    image
    image
  2. Go to the "Bot" tab and click on the "Reset token" button
    image
    image
  3. Copy the token
    image
  4. Download the plugin from Releases tab or from Spigot page.
  5. Put downloaded .jar into ./plugins folder of your server.
  6. Restart your server or enter reload command.
  7. Go to ./plugins/DiscordVerificator folder and open config.yml
  8. Replace DISCORD_BOT_TOKEN with the token you've copied previously
  9. Save the config and run dvreload command

  10. Everything is done! Now you can link players with the link command and
    invite this bot to your Discord server (to make them able to run confirm <code> command to the Discord bot)