zxSrv · Discord-Minecraft bridge

by Rishabh Free
Discord bridge chat sync rank sync account linking API ready

⚡ Features

Chat bridge

Bidirectional relay between Minecraft and Discord with customizable formats.

Account linking

Secure code-based linking, sync Discord roles with LuckPerms groups.

Rank bridge

Bidirectional rank sync: LuckPerms ↔ Discord roles. VIP, admin, etc.

Console logs

Forward server logs to Discord, execute commands from Discord.

Moderation

Ban, kick, unban via Discord with detailed log channel.

User stats

PlaceholderAPI stats in Discord (/user stats) with custom fields.

Required dependencies

auth plugin = AdvancedAuth (used for password management via Discord)

📄 Configuration (config.yml)

config.yml YAML · 350 lines
# ==============================================
#               zxSrv Configuration
# ==============================================
# Main configuration file for the zxSrv Discord-Minecraft bridge plugin.
# Visit: https://plugins.zenuxs.in/zxsrv for documentation and support.
# ==============================================

# Enable debug logging (useful for troubleshooting)
debug: false

# ==============================================
#                 DISCORD SETTINGS
# ==============================================
discord:
  # Your Discord bot token (from Discord Developer Portal)
  token: "BOT_TOKEN"
  # The ID of your Discord server (guild)
  guild-id: "GUILD_ID"
  # Role ID that grants admin permissions for Discord commands (e.g., /adminpassword)
  admin-role-id: "ADMIN_ROLE_ID"

# ==============================================
#                 CHANNEL IDS
# ==============================================
# Replace the IDs below with your actual Discord text channel IDs.
channels:
  chat: 123456789012345678         # Channel for Minecraft ↔ Discord chat bridge
  console: 123456789012345678       # Channel for console logs and command execution
  join-leave: 123456789012345678    # Channel for join/leave messages
  account-link: 123456789012345678  # Channel where players send their linking codes
  moderation: 123456789012345678    # Channel for moderation logs (bans, unbans, kicks)
  user-stats: 123456789012345678    # Channel where /user stats can be used (optional)

# ==============================================
#                 FEATURE TOGGLES
# ==============================================
# Enable or disable individual features globally.
features:
  chat-bridge: true          # Relay chat messages between Minecraft and Discord
  join-leave-logs: true       # Send join/leave messages to Discord
  console-logs: true          # Send console output to Discord (and allow command execution)
  account-link: true          # Allow players to link their Minecraft and Discord accounts
  rank-bridge: true           # Sync ranks/roles between Minecraft (LuckPerms) and Discord
  user-stats: true            # Enable /user command to show player statistics
  moderation: true            # Enable moderation commands (ban, unban, kick via Discord)

# ==============================================
#                 CHAT BRIDGE
# ==============================================
chat:
  # Relay Minecraft chat to Discord?
  minecraft-to-discord: true
  # Relay Discord chat to Minecraft?
  discord-to-minecraft: true

  # Format for messages sent from Discord to Minecraft.
  # Use %user% for Discord username and %message% for the message.
  minecraft-format: "&7[&bDiscord&7] &f%user% &8» &7%message%"

  # Format for messages sent from Minecraft to Discord.
  # Use %player% for Minecraft player name and %message% for the message.
  discord-format: "**[MC] %player% » %message%**"

  # Optional embed for Minecraft → Discord messages.
  embed:
    enabled: false            # Set true to use an embed instead of plain text
    color: "#00b0f4"          # Hex color code for the embed
    title: "Minecraft Chat"   # Embed title
    footer: "zxSrv"           # Footer text

# ==============================================
#              JOIN / LEAVE MESSAGES
# ==============================================
join-leave:
  embed: true                 # Send join/leave messages as embeds? If false, plain text.

  # Plain text messages (used if embed: false)
  join-message: "🟢 **%player% joined the server**"
  leave-message: "🔴 **%player% left the server**"

  # Embed settings for join and leave events
  embed-settings:
    join:
      title: "Player Joined"
      description: "%player% joined the server"
      color: "#00ff00"
    leave:
      title: "Player Left"
      description: "%player% left the server"
      color: "#ff0000"

# ==============================================
#                 CONSOLE LOGS
# ==============================================
console:
  enabled: true               # Enable console logging to Discord
  embed: false                # Send logs as embeds? (false = plain code blocks)
  show-commands: true         # Log commands executed by players/console?
  show-errors: true           # Log severe errors?
  filters:                    # Lines containing any of these strings will NOT be logged
    - "UUID of player"
    - "Disconnect"

# ==============================================
#              ACCOUNT LINKING
# ==============================================
account-link:
  enabled: true               # Enable linking feature
  code-length: 4              # Number of digits in the linking code
  expire-seconds: 300         # Time (in seconds) before a code expires (5 minutes)

  # Messages shown to players
  messages:
    minecraft-code: "&aYour linking code is &e%code%"
    success: "✅ Account successfully linked."
    already-linked: "❌ Your account is already linked."
    invalid-code: "❌ Invalid linking code."
    expired-code: "❌ This linking code expired."

# ==============================================
#                  SECURITY
# ==============================================
security:
  password-cooldown: 300      # Cooldown between password changes (seconds) – currently unused
  max-link-attempts: 5        # Maximum failed attempts before a code is invalidated

# ==============================================
#           ADVANCED AUTH INTEGRATION
# ==============================================
# Allows changing Minecraft passwords via Discord (if your auth plugin supports an API).
advancedauth:
  enabled: true
  api-url: "https://plugins.zenuxs.in/api/admin/changePassword"
  api-key: "YOUR_API_KEY"

# ==============================================
#                RANK BRIDGE
# ==============================================
# Syncs LuckPerms groups with Discord roles.
rank-bridge:
  enabled: true

  # When a Minecraft player has a LuckPerms group, give them this Discord role.
  minecraft-to-discord:
    vip: 112233445566778899       # Discord role ID for group "vip"
    admin: 998877665544332211      # Discord role ID for group "admin"

  # When a Discord user has a role, give them this LuckPerms group.
  discord-to-minecraft:
    112233445566778899: vip        # Discord role ID -> Minecraft group
    998877665544332211: admin

# ==============================================
#               USER STATISTICS
# ==============================================
# Allows displaying player statistics via Discord's /user command.
# Requires PlaceholderAPI.
user-stats:
  embed: true                     # Send stats as an embed? If false, plain text.

  # Placeholders from PlaceholderAPI. The key is an internal name, the value is the placeholder.
  placeholders:
    playtime: "%statistic_time_played%"
    blocks-mined: "%statistic_mine_block%"
    distance-walked: "%statistic_walk_one_cm%"

  # Embed customization
  embed-settings:
    title: "Player Statistics"
    description: "Stats for %player%"   # %player% will be replaced
    color: "#3498db"
    footer: "zxSrv"
    thumbnail: ""                        # Optional image URL
    timestamp: false                      # Add a timestamp to the embed?
    fields:                               # Display names for each placeholder
      playtime: "Playtime"
      blocks-mined: "Blocks Mined"
      distance-walked: "Distance Walked"

# ==============================================
#                MODERATION
# ==============================================
# Discord commands for Minecraft moderation.
moderation:
  mcban:
    enabled: true
    log-to-channel: true          # Log ban actions to the moderation channel
  mcunban:
    enabled: true
  mckick:
    enabled: true

# ==============================================
#                  MESSAGES
# ==============================================
# Customise various response messages.
messages:
  password-changed: "✅ Password changed successfully."
  password-failed: "❌ Failed to change password."
  account-linked: "✅ Your account has been linked."
  account-not-linked: "❌ Your Discord account is not linked."
  user-not-found: "❌ Player not found."
  link-success-mc: "&aYour account has been linked to Discord user &e%discord_user%"
  link-success-dc: "✅ Your Discord account has been linked to Minecraft player **%player%**"

# ==============================================
#                DATABASE
# ==============================================
# Stores linked accounts persistently.
database:
  type: sqlite                     # or "mysql"
  mysql:
    host: localhost
    port: 3306
    database: zxsrv
    username: root
    password: ""
    useSSL: false

# ==============================================
#              BOT ACTIVITY STATUS
# ==============================================
bot-status:
  type: playing                    # playing, streaming, listening, watching, competing
  text: "Minecraft"

# ==============================================
#              CUSTOM COMMANDS
# ==============================================
# Define your own commands that the bot will respond to in any text channel.
# Each command has a trigger word (the first word of the message) and a response.
# Response can be plain text or an embed.
custom-commands:
  ip:
    type: text                     # "text" or "embed"
    message: "Server IP: play.example.com"
  rules:
    type: embed
    embed:
      title: "Server Rules"
      description: "1. Be respectful\n2. No griefing"
      color: "#ffaa00"
      footer: "zxSrv"
      thumbnail: ""                 # Optional image URL
      timestamp: false