Feature: Role Sync

The Role Sync feature allows you to automatically grant in-game permissions or run commands for players based on the roles they have in your Discord server. This is perfect for rewarding supporters, Nitro boosters, or assigning staff ranks.

Requirement: The Account Linking feature (features.linking.enabled) must be set to true in config.yml for Role Sync to work.

How It Works

The synchronization process is triggered at two key moments:

  1. On Link Completion: The moment a player successfully links their Minecraft and Discord accounts.
  2. On Player Join: Every time a linked player joins the server (this can be disabled).

During a sync, the plugin checks the player's Discord roles against the mappings you define in role-sync.yml. If a match is found, the corresponding console commands are executed for that player.

Configuration: role-sync.yml

This feature is controlled entirely by the role-sync.yml file.


enabled: true

# If true, the sync will also run every time a linked player joins.
sync-on-join: true

# 'sync-mappings' is where you define your rules.
sync-mappings:
  # This is a unique name for your rule, it can be anything.
  nitro_booster_sync:
    # A list of Discord role names. The player needs just ONE of these.
    # This IS case-sensitive and must match your Discord role name exactly.
    discord-roles:
      - "Nitro Booster"
    # A list of commands to run if a role matches.
    # Placeholders: %player_name%, %player_uuid%
    commands:
      - "lp user %player_name% parent add nitro"

  supporter_sync:
    discord-roles:
      - "Supporter Tier 1"
      - "Patreon"
    commands:
      - "lp user %player_name% parent add supporter"
      - "eco give %player_name% 500"
      - "say Thank you for supporting the server, %player_name%!"
        

Key Concepts