Servr.link - Centralised Minecraft <-> Discord account linki
1.1.0Centralised service to improve the efficiency of connection between Minecraft and Discord accounts
Introduction
After seeing numerous resources that offer the connection between Minecraft and Discord accounts, I was inspired to create a centralised service to make it easier for both server owners and players to handle.
For players, a centralised service means they only have to connect their accounts once, ever. For server owners, it means that such a service is much easier to setup, since servr.link manages all of the backend happenings.
In addition to this, I saw that many of these resources opted to use a bot for verification, rather than the standard Oauth2 API, which should be used over a bot.
My vision for this service is for it to become the go-to API for development in which Minecraft and Discord are interlinked.
Website + FAQ
https://servr.link
How do I use this plugin?
Simply download and drag and drop into your plugins folder! A configuration file is available, however the default options will work.
Support
Click on the above image
How does it work?
In summary, servr.link handles all of the workings, meaning that for server owners, this plugin is drag and drop.
1) When the user executes the /link command, they are sent a configurable message. This message prompts the user to visit our website by default, however, it is recommended that you change it to prompt the user to connect to our verification server via their Minecraft client, by connecting to servr.link.
2) When the user joins the verification server, a 32 character key is generated and is inserted into our Redis cache, with an expiry of 10 minutes, mapping the key to the player's UUID. The player is then prompted to visit a URL, using the key as a URL parameter.
3) When the user opens the URL, the key is stored as a cookie. The user is then redirected to Discord to complete an Oauth challenge.
4) When the user is redirected back to the servr.link website, the key is retrieved from their cookies and their UUID is retrieved from our Redis cache.
5) Discord provides servr.link with a temporary access token that is used to retrieve the user's Discord user ID, and then is discarded.
6) The player's UUID is mapped to the user's Discord ID and is then stored in our MariaDB database permanently. Plugins can then use our RESTful API to query our database.
Decentralisation
If you would like to run your own Registry (the web app), so that authentication can be performed from your Minecraft server, you will require a VPS. You need to have access to a Redis cache, as well as a MySQL or MariaDB (recommended) database. Then, run a Registry instance and install the Manager plugin on your Minecraft server, which should be connected to your Redis cache. More documentation will be coming on this later.
Using the API
The API endpoints are listed on our website, however, we have created some wrappers in different programming languages to make the use of the API easier for developers.
JVM (on a Minecraft server)
Depend on the "ServrLink" plugin to make use of the built-in API.
https://github.com/ServrLink/Plugin/blob/master/README.md
JVM (not on a Minecraft server)
A maven artifact will be created soon, however, you can use the following snippet for now:
https://gist.github.com/Dot-Rar/ea4f5056752260ce58289c406b1a1f7d
NodeJS
There is an NPM package available:
https://www.npmjs.com/package/servrlink-api
Elixir (WIP)
This wrapper is kindly maintained by @bramhaag:
https://github.com/ServrLink/elixir-api
Python (WIP)
Code is finished, needs to be packaged and documented.
https://github.com/ServrLink/python-api
Golang (WIP)
This wrapped is kindly maintained by @_Cory_:
https://github.com/ServrLink/servrlinkapi-go
Is your language not listed? Join our Discord server and we'll create you a repository so that you can create a wrapper for the community.
Similar projects
Plugin →Let Me Despawn
Improves performance by tweaking mob despawn rules. Say bye to pesky unintentional persistent mobs.
25MSueta
JourneyMap
Real-time map used for mapping in-game or your browser as you explore.
14.7MSueta
Emotecraft
Create your own emotes in Minecraft.
7.5MSueta
Simple Tpa
A simple tpa plugin which sends requests
5.4MSueta
Common Network
Forge and Fabric Unified Networking Solution
3.9MSueta
Set Home
A lightweight plugin for players to set their homes.
3.8MSueta