Installing
Basic JSON or JSON5 knowledge is highly recommended.
Some Discord integration mods use a different version of JDA (the library used to interact with Discord), this may cause issues or failures.
Installing the mod
Make sure you download the correct version for your server's Minecraft version.
- Download the mod from Modrinth
- Download the required dependencies FabricAPI and Fabric Language Kotlin
- Put the mod in your mods folder
- Start the server, this will generate the config file
- Stop the server
Setting up the Discord bot
Creating the bot
Important settings
Getting the token
Getting the client ID
Adding to your server
Configuring the mod
Adding the bot token
{
"prefix": "np!",
// Your bot token. Never share it, anyone with it has full control of the bot
"token": "NEVER SHARE YOUR BOT TOKEN",
"clientId": "937880657697308682",
"discordServerId": "894529860145920118",
/*...*/
}
Adding the client and server ID
To get the server id you need to enable developer mode on Discord.
On the app go to Settings > App Settings > Advanced
and enable Developer Mode
.
Paste the client ID you got from the bot page into the clientId
entry in the config.
To get the server ID you need to right click the server icon and click Copy Server ID
.
{
/*...*/
// Your bot token. Never share it, anyone with it has full control of the bot
"token": "NEVER SHARE YOUR BOT TOKEN",
"clientId": "937880657697308682",
"discordServerId": "894529860145920118",
/*...*/
}
Setting the entries
On the config file, entries
will be empty by default, there you will configure what the server will do when
whitelisting the players.
There are 4 types of entries, for vanilla you have TEAM
and COMMAND
, if you have luckperms you can also use
LUCKPERMS_GROUP
and LUCKPERMS_PERMISSION
.
All of them takes a list of roleIds
that will be used to whitelist the players, and a type
that will be used to
determine what the server will do when whitelisting the players.
The default format is
{
//The Discord role ids that will be used to whitelist the players
"roleIds": ["Discord role id"],
//The method that will be used to whitelist the players
"type": "TYPE"
}
Team example
{
"roleIds": ["Discord role id"],
"type": "TEAM",
"team": "minecraft_team_name"
}
Command example
{
"roleIds": ["Discord role id"],
"type": "COMMAND",
"addCommand": "scorereboard players set %player% cool_people 1",
"removeCommand": "scorereboard players reset %player% cool_people"
}
Whitelist example
This was added on 1.0.0 Alpha 6!
{
"roleIds": ["Discord role id"],
"type": "WHITELIST" //It does no extra action, it just whitelists the player
}
Luckperms examples
- Group
- Permission
{
"roleIds": ["Discord role id"],
"type": "LUCKPERMS_GROUP",
"group": "TIER_1"
}
{
"roleIds": ["Discord role id"],
"type": "LUCKPERMS_PERMISSION",
"permission": "minecraft.command.teleport"
}
The admins
entry is an option that allows the users in it to use the developer commands. In the option you put the
ID of the users you want to have access to the dev commands.
You can find an example configuration file here
{
// DO NOT CHANGE, CHANGING THIS WILL BREAK THE CONFIGURATION FILE
"CONFIG_VERSION": 1,
// When enabled it will keep a cache of previous registered users and will use it to automatically add the user back (if they have the proper role)
"enableWhitelistCache": true,
// The period the mod looks for outdated and invalid entries, this is an extra action to guarantee everything is updated
"updatePeriod": 60,
// A list of ids to allow users to use the debug commands
"admins": [
"387745099204919297",
"483715272960901120",
"302481489897979905"
],
// The activity shown on the bot status
"botActivityType": "PLAYING",
// The bot command prefix
"prefix": "np!",
// The time in seconds the bot will lock a whitelist entry after it is added or updated, use -1 to disable changing the linked username
"lockTime": "1w",
// Your bot token. Never share it, anyone with it has full control of the bot
"token": "NEVER SHARE YOUR BOT TOKEN",
"discordServerId": "894529860145920118",
// When enabled, all interactions and slash commands will be ephemeral, meaning only the user can see the response.
"ephemeralReplies": true,
// The whitelist entry settings, please refer to the documentation to set them up
"entries": [
{
"roleIds": ["744941527545020468"],
"type": "WHITELIST"
}
]
}