Match History
Every finished duel is saved with each player's result, rating changes, combat counters, final health and final inventory. Players browse it in game; plugins and websites read it through the API.
Overview
- On by default. Duels, queue matches, rematches, party matches and tier tests are saved. Bot matches are skipped.
- Ranked means ranked queue matches and tier tests. Everything else lists under Unranked.
- Old matches are deleted after
keep-days(30), on startup and every 6 hours. - All database work runs on a background thread, so saving and browsing never block the server.
Opening it
| Command | Description | Permission |
|---|---|---|
/matchhistory [player] | Your matches, or another player's (online or offline) | none |
/match-history, /mh, /matches | Aliases | none |
The menu always opens on Unranked, with a Ranked tab and pages of matches, newest first (page-size, default 7, in the dialog file). With gui.mode: DIALOG it is a dialog; otherwise a chest menu with a filter button and page arrows.
What a match shows
Clicking a match opens its page: kit, arena, match type, duration, score and when it ended, then one block per player.
| Per player | Notes |
|---|---|
| Result | Win, loss or draw |
| Elo change | Only when the match changed Elo (ranked) |
| Tier rating and tier change | Only when tiers are on and the match counted |
| Kills, deaths, hits | Hits are melee and projectile hits on other match players |
| Damage dealt and taken | In hearts |
| Totems, golden apples, ender pearls, potions | Used during the match |
| Health, absorption, hunger | When the player was eliminated or when the match ended |
| Final inventory | Click to open a read-only view: storage, armor and offhand |
The inventory view shows copies of the saved items. Every click and drag is cancelled, including shift-click, hotbar keys and creative mode, so nothing can be taken out.
Configuration
In config.yml. Changes apply on /shyamduels reload-config confirm.
match-history:
enabled: true
# Days before a match is deleted. 0 keeps matches forever.
keep-days: 30
# Save each player's final inventory (about 1-4 KB per player per match).
save-inventories: true
Texts: dialog-menus/match-history.yml (dialog mode), menus/match-history.yml (chest mode) and the match-history section of lang/messages.yml.
Storage
- Tables
match_history(one row per match) andmatch_history_players(one row per player) in the stats database, on SQLite or MySQL. - Inventories are stored in Paper's item byte format. If a player's items cannot be saved, the match is still saved without them.
- Writes go through one ordered background queue; a server stop waits for queued writes.
Developer API
ShyamDuelsAPI.matchHistory() returns the MatchHistoryService (API 2.1): pages of a player's matches, one match with inventories, recent matches and matches since a time, all as CompletableFutures. MatchRecordedEvent fires on the main thread when a match is saved. See Services, Data Models and Events.