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

  1. Create a rule for the role:
  1. In the dashboard, open "Role sync".
  2. Under "Create a rule for a role", pick the role, for example @VIP.
  3. Under "When the role is added", enter lp user {player} parent add vip.
  4. Under "When the role is removed", enter lp user {player} parent remove vip.
  5. Check the preview under "Command that runs" and click "Save".
  1. Allow the commands in the Minecraft server's config. With the default whitelist, the server rejects them.
yaml
# Spigot, Paper, Folia: plugins/mc-sync/config.yml
commands:
  mode: allow
  allow: ["lp user * parent add", "lp user * parent remove"]
properties
# Fabric, Quilt, Forge, NeoForge: config/mc-sync.properties
commands.mode=allow
commands.allow=lp user * parent add,lp user * parent remove
  1. Run /mcsync reload. On Forge before Minecraft 1.19, restart the server.
  2. 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.

  1. In the dashboard, open "Role sync" and go to "Ranks from Minecraft".
  2. Pick the rank under "Rank in game" and the role under "Discord role".
  3. Click "Add".
  4. 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 addEffect
"Create a rule for a role"roleThe Discord role. Each role has one rule.
"When the role is added"on-grantCommand when someone gets the role
"When the role is removed"on-revokeCommand 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 list shows all rules, /role-sync remove role: @VIP deletes 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.mode and commands.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.