SunPheonyx-PlayerStatsSync icon

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.

Last updated 5 days ago
Total downloads 87
Total rating 0 
Categories AI Generated Misc Tools Server-side Client-side Utility
Dependency string SunPheonyx-PlayerStatsSync-1.1.2
Dependants 0 other packages depend on this package

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2360 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.

Preferred version: 5.4.2360

README

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
  }
}
  • stats uses Valheim's own PlayerStatType names, and leaves out anything at zero.
  • updated is a Unix timestamp.
  • File names contain the player's platform ID, so don't publish them as they are.

Good to know

  • Stats count play on your server only. The game doesn't record where a stat was earned, so the server tracks each character's totals in BepInEx/config/PlayerStatsSync.totals. Keep that folder, or characters start again from zero.
  • A character joining for the first time starts from zero. The first minute or so of each session isn't counted, because the player's first update sets the starting point.
  • Damage dealt is the strength of the hit before the enemy's resistances. Damage taken is measured after armour.
  • Stats are sent by each player's game, so they could be faked. It's built for groups of friends, not competitive servers.

Feedback

Found a bug or have an idea? Open an issue on GitHub.