Confirm with your password

StatCredit

Bug fix: trees you fell count toward The Lumberjack achievement even when a friend's game owns them. Install on every player.

Client & Server

Stars
0
Downloads
4
Version
1.0.0
Updated
Author
SquaredCub
Virus scan
✓ Scan successful
Runs on
Client & Server

Description

StatCredit

Fixes a multiplayer bug: trees you fell in an area a friend loaded first don't count toward The Lumberjack achievement (500 trees). With StatCredit, they do.

The bug

You chop trees with friends, but your Lumberjack progress barely moves, or a friend's stays at zero.

Valheim only counts a felled tree for you if your own game "owns" it, and whoever loads an area first owns everything in it. So when a friend got somewhere first, every tree you fell there counts for nobody: not you, not them. The more you play together, the more trees go uncounted.

Install it on every player. Nothing is needed on the server.

The fix

When your game owns a tree and a friend's hit fells it, StatCredit tells their game, and their game counts the tree exactly as it would have counted one of their own. Trees you fell in your own area still count the normal way, never twice.

  • Both games need the mod: the owner sends, the chopper counts. If either is missing it, nothing happens and nothing breaks.
  • Works on dedicated servers and on games hosted from the game. The server only forwards the message, so it needs nothing.
  • Achievement progress still follows the game's usual rules. On a modded game it only counts if something like Unshamed re-enables achievements.

Not covered

  • Trees felled before you installed it are lost: the game never recorded them anywhere.
  • A tree knocked down by a falling log has no player behind the hit, so it counts for nobody, as in vanilla.
  • Only trees. Logs, rocks and hit counts have the same ownership problem, but no achievement reads them and the game shows them nowhere.

Technical details

The game runs a tree's damage only on the game that owns it, and TreeBase.RPC_Damage counts the Tree stat only when the hit came from that game's own player. Kills don't have this problem: the game sends every attacker a "you got a kill" message (RPC_RegisterKill). Trees never got one. StatCredit adds that message for trees.

Manual installation instructions
1

Install BepInExPack Valheim

BepInExPack Valheim is required to run mods in Valheim.

Download BepInExPack Valheim 5.4.2351 · View mod page

Check out the mod page for detailed installation instructions.

2

Install StatCredit

This mod must be installed on both the client and the server.

Download StatCredit 1.0.0

Extract the ZIP and place the file(s) into the BepInEx/plugins/ folder inside your Valheim game folder.