Stats and leaderboards
Stats, leaderboards and match history: commands, menus, holograms, settings and storage.
MineDuels stores every player's stats per kit, and the finished matches. Players see them in commands and menus. Admins can show leaderboards as holograms.
Player commands
| Command | Alias | Shows |
|---|---|---|
/stats [player] | ELO, wins, losses and streaks of a player, per kit | |
/leaderboard | /lb | The ranked kits to choose from |
/leaderboard <kit> | /lb <kit> | The top players of a kit |
/history [player] | /matchhistory | The last matches of a player |
What is stored
For each player and kit: ELO, ranked wins and losses, current and best win streak, and unranked wins and losses. Across all kits: the current and best win streak. Each finished match: the kit, whether it was ranked, the length, how it ended, the scores and each player's result and ELO change.
The data is saved to the database (SQLite or MySQL). Online players' profiles are written in batches every storage.autosave-minutes (5 by default) and when they leave. The values the game shows are always current.
Leaderboard settings
In matchmaking.yml:
leaderboard:
size: 10
refresh-seconds: 60
overall-min-games: 10| Key | Default | Meaning |
|---|---|---|
size | 10 | Places per board, 1 to 100 |
refresh-seconds | 60 | How often the boards are rebuilt, 10 to 3600 |
overall-min-games | 10 | Ranked games a player needs in total to be on the overall board |
The boards are rebuilt in the background and kept in memory. Menus, holograms, placeholders and the web API read the stored copy, so showing a board never costs a database query. A change of size or refresh-seconds needs a restart. overall-min-games applies with /md reload from the next refresh.
A player appears on a kit board after at least one ranked game in that kit. The order is ELO, highest first.
Match history
history:
enabled: true
keep-days: 30
max-matches: 100000| Key | Default | Meaning |
|---|---|---|
enabled | true | false stores no new matches |
keep-days | 30 | Matches older than this many days are deleted. 0 turns the age limit off |
max-matches | 100000 | The newest matches kept. 0 is no cap |
Old matches are pruned in the background about every six hours. Over HTTP, GET /matches and GET /players/<name>/matches read the history. See Matches.
Leaderboard holograms
A hologram is a floating text of a kit's top players.
/md hologram create nodebuff-top nodebuff
/md hologram list
/md hologram delete nodebuff-topcreate <name> <kit> places it where you stand. The kit must be ranked. Holograms are saved in holograms.yml. They are text display entities that are never saved with the world. They are spawned when their chunk loads and removed on shutdown, so a restart never leaves a copy behind.
The text follows each leaderboard refresh. The lines are in messages.yml:
hologram-title: "<gradient:#ff5f6d:#ffc371><bold>Top <kit></bold></gradient>"
hologram-line: "<gray>#<position></gray> <white><player></white> <dark_gray>-</dark_gray> <yellow><elo></yellow>"
hologram-empty: "<gray>No ranked games yet"Stats menus
The stats menus are under guis/stats/. See GUIs for how menu files work.
Placeholders
Use the stats and leaderboard placeholders in the scoreboard, tab list, menus and PlaceholderAPI. See Placeholders.
From other tools
- A plugin:
MineDuelsApi.stats(...),top(...)andhistory(...). See the Developer API. - HTTP: Players and stats and Leaderboards.
Related: Ranked and ELO, Ranks and bonuses.