
You are viewing a potentially older version of this package. View Latest Version
PlayerStatsSync
Sends each player's character stats, plus damage dealt and taken, to your dedicated server as JSON files. Build your own leaderboards and player pages.Player Stats Sync
Sends each player's character stats to your dedicated server and saves them as JSON files, so you can build leaderboards, player pages or Discord bots around them.
What it does
- Reads the stats Valheim already tracks for each character: kills, deaths and their causes, trees felled, distance travelled, pieces built, and about 200 more.
- Adds two stats the game doesn't track: damage dealt and damage taken. These count from when the mod is installed.
- Sends everything to the server every 60 seconds, and when a player logs out.
- Saves one file per player on the server.
This mod has no in-game screen. It collects the data, and you decide what to do with it.
Installation
Install it on the server and on each player who wants their stats recorded. Players without the mod can still join, they just won't get a stats file.
Stats files
The server writes one file per player to:
BepInEx/config/PlayerStatsSync/<platform-id>.json
{
"name": "Ragnar",
"character": "ragnar",
"updated": 1793480000,
"damage_done": 18342.5,
"damage_taken": 4210.2,
"stats": {
"EnemyKills": 412,
"Deaths": 27,
"Tree": 311
}
}
statsuses Valheim's ownPlayerStatTypenames, and leaves out anything at zero.updatedis a Unix timestamp.- File names contain the player's platform ID, so don't publish them as they are.
Good to know
- Character stats are lifetime totals across every world that character has played, not just your server.
- Damage dealt is the strength of the hit before the enemy's resistances. Damage taken is measured after armour.
- Damage is stored in the character file, so it follows the character.
- Stats are sent by each player's game, so they could be faked. It's built for groups of friends, not competitive servers.