You are viewing a potentially older version of this package. View all versions.
SunPheonyx-PlayerStatsSync-1.1.2 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.

Date uploaded a week ago
Version 1.1.2
Download link SunPheonyx-PlayerStatsSync-1.1.2.zip
Downloads 36
Dependency string SunPheonyx-PlayerStatsSync-1.1.2

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.

CHANGELOG

Changelog

1.1.2

  • Added a link to the GitHub repo, for bug reports and ideas. The mod itself hasn't changed.

1.1.1

  • Plugin ID is now SunPheonyx.PlayerStatsSync. Nothing else changes, and stats carry on as before.

1.1.0

  • Stats files now count play on this server only. Characters already in a stats file keep their current numbers and build from there; new characters start from zero.
  • Only the server needs this update.
  • New icon.

1.0.0

  • First release: sends character stats to the server, and adds damage dealt and damage taken.