Features
Role sync
Keep Discord roles and ranks on your Minecraft server in step, in both directions.
Role sync connects Discord roles to ranks on your Minecraft server. When someone gets a role in Discord, the server runs a command. When someone has a LuckPerms rank in the game, the bot gives them the matching Discord role. Both only work for players who have linked their accounts.
Set up
From Discord to the game
- Create a rule for the role:
- In the dashboard, open "Role sync".
- Under "Create a rule for a role", pick the role, for example
@VIP. - Under "When the role is added", enter
lp user {player} parent add vip. - Under "When the role is removed", enter
lp user {player} parent remove vip. - Check the preview under "Command that runs" and click "Save".
/role-sync add role: @VIP on-grant: lp user {player} parent add vip on-revoke: lp user {player} parent remove vip
- Allow the commands in the Minecraft server's config. With the default
whitelist, the server rejects them.
# Spigot, Paper, Folia: plugins/mc-sync/config.yml
commands:
mode: allow
allow: ["lp user * parent add", "lp user * parent remove"]# Fabric, Quilt, Forge, NeoForge: config/mc-sync.properties
commands.mode=allow
commands.allow=lp user * parent add,lp user * parent remove- Run
/mcsync reload. On Forge before Minecraft 1.19, restart the server. - Give the role to a linked member. The command runs on every Minecraft server connected to this Discord server.
More on commands.mode is under Commands from Discord.
From the game to Discord
LuckPerms has to run on the Minecraft server. This direction is only available in the dashboard.
- In the dashboard, open "Role sync" and go to "Ranks from Minecraft".
- Pick the rank under "Rank in game" and the role under "Discord role".
- Click "Add".
- If several Minecraft servers are connected, pick one under "Which server decides the ranks?".
The bot updates the roles when a player joins the server and when their rank changes. It only adds and removes the roles listed here.
Settings
| Dashboard | /role-sync add | Effect |
|---|---|---|
| "Create a rule for a role" | role | The Discord role. Each role has one rule. |
| "When the role is added" | on-grant | Command when someone gets the role |
| "When the role is removed" | on-revoke | Command when someone loses the role |
| "Rank in game" and "Discord role" | Which rank brings which role, up to 100 mappings | |
| "Which server decides the ranks?" | Only this server adds and removes roles. Without a choice, every server may. |
{player}is replaced with the Minecraft name. Without it, everyone gets the same command.- Commands go without the slash, 300 characters at most. One of the two commands may stay empty.
- The commands run with console permissions.
/role-sync listshows all rules,/role-sync remove role: @VIPdeletes one.
Problems
The command doesn't run in the game
- The person must be linked on this Discord server. They can check with
/link show. - The Minecraft server must accept the command under
commands.modeandcommands.allow, see Set up. - Rejected commands show up in the command log. Set its channel with
/notices channel purpose: commands.
People who already had the role don't get the rank
The command only runs when the role is added or removed. Anyone who had it before linking or before the rule existed gets nothing. Take the role away and give it again.
The Discord role isn't given
- The bot's role must sit above the role it should give, in the Discord server settings. Otherwise the dashboard shows "Bot role too low".
- The player must be linked and join the server after the mapping was created.
"Rank in game" is empty
The server hasn't reported a rank yet. Check that LuckPerms is running and the plugin is up to date (download). Ranks show up once a player joins or a rank changes.
You can't map a role
You can only map roles below your own highest role. Roles with moderation rights such as kick, ban or manage roles can only be mapped by an administrator.
The role keeps coming and going
Two Minecraft servers report different ranks for the same player. Pick one under "Which server decides the ranks?".
Background: why a command and not a group
From Discord to the game, the bot only stores the command. That works with LuckPerms, PermissionsEx and any other plugin that has commands.
From the game to Discord, something has to report when a rank changes. Only LuckPerms does that. The server then sends all of the player's ranks, not only the change. If a report gets lost, the next one makes up for it.