Skip to main content

Player Stats & Leaderboards

XDiscordUltimate automatically tracks player activity and can publish a live, auto-updating leaderboard embed to a Discord channel. Two modules work together here: player-stats (collection) and leaderboard (presentation).

What’s Tracked

The player-stats module writes to the player_stats table. Each row holds:
FieldDescription
joinsNumber of times the player has joined the server
messages_sentTotal in-game chat messages sent
deathsTotal deaths
playtime_minutesAccumulated playtime, in minutes
first_joinTimestamp of the player’s first join
last_seenTimestamp of the player’s most recent activity

Commands

# In-game
/stats [player]          # Show stats for yourself or another player
                          # Aliases: /playerstats, /pstats
# Discord
/stats [player]          # Same lookup, from your Discord server
Omit the player argument to view your own stats.

Player Stats Configuration

The player-stats module only needs an enable toggle — tracking is fully automatic.
features:
  player-stats:
    # Track joins, messages, deaths, playtime, first/last seen in the player_stats table.
    enabled: true

Leaderboard Configuration

The leaderboard module edits a single embed in place on each update-interval, using data from the player_stats table.
features:
  leaderboard:
    enabled: true
    # Channel that holds the leaderboard embed.
    channel-id: "1234567890123456789"
    # Message ID of the embed to edit. The bot will update this message in place.
    message-id: "1234567890123456789"
    # Seconds between leaderboard refreshes.
    update-interval: 300
    # How many players to display.
    top-players: 10
    # Stat used to rank players (e.g. KILLS, DEATHS, PLAYTIME).
    default-type: "KILLS"
    # Optional custom thumbnail URL for the embed.
    custom-thumbnail: ""
The bot edits the same message every interval rather than posting a new one. Point message-id at an existing message the bot has permission to edit, and the leaderboard will never clutter your channel.

Next Steps

Economy Bridge

Link Discord users to in-game balances via Vault.

Database

Read the schema backing player_stats and other modules.