Valheim
Install

Details

Last Updated
First Uploaded
Downloads
321
Likes
1
Size
108KB
Dependency string
Baka_Gaijin-SledgeMajsterLateFix-1.1.0
Dependants
ADDatHost Valheim hosting
30% off!

SledgeMajsterLateFix

A lightweight companion patch for balrond_sledgemajster that extends its battleaxe-swing attack swap to sledge weapons registered by late-loading mods like balrond_arsenal_reborn.


The Problem

If you run both balrond_sledgemajster and balrond_arsenal_reborn, you'll notice that only vanilla sledges (Stagbreaker, Iron Sledge, Demolisher) get the attack swap. Arsenal Reborn's sledges — SledgeStone, SledgeBlackmetal, SledgeSilver, SledgeFlametal, SledgeFrosteel, SledgeDarksteel, SledgeStagbreakerNEW, and SledgeAwakened — are left untouched.

This happens because of a load-order timing issue:

  1. balrond_sledgemajster scans for sledge weapons at ZNetScene.Awake (an early Unity lifecycle event)
  2. balrond_arsenal_reborn registers its weapons later via Jotunn's item system
  3. By the time Arsenal Reborn's sledges exist in the prefab database, sledgemajster's scan has already finished

The weapons have the correct naming (SledgeStone_bal, etc.) and would pass the detection check — they simply don't exist yet when the check runs.


The Fix

This plugin waits for the world to fully initialize, then performs a second scan that catches everything sledgemajster missed:

  • Uses SledgeIron (already processed by sledgemajster) as a reference template
  • Scans both m_prefabs and m_namedPrefabs for any sledge-named weapon that wasn't processed
  • Moves the original AoE ground slam to the secondary attack (middle click)
  • Clones the battleaxe-style swing as the new primary attack (left click)
  • Logs each patched weapon to BepInEx/LogOutput.log for verification

After installation, check your log for:

[Info] SledgeMajster Late Fix complete: patched 8 additional sledge(s)

Installation

  1. Install via Thunderstore Mod Manager (recommended) or manually place SledgeMajsterLateFix.dll into BepInEx/plugins/
  2. Required on both server AND all clients — attack definitions are loaded locally on each machine. This is now hard-enforced: the mod uses Jötunn's NetworkCompatibility (EveryoneMustHaveMod, Minor strictness), so any client missing the mod or on a mismatched major.minor version is rejected at the connection handshake with an error screen.
  3. No configuration needed — the plugin is fully automatic

Compatibility

  • Required: BepInEx 5.4+, balrond_sledgemajster 1.0.3+
  • Designed for: balrond_arsenal_reborn (but works with any mod that registers sledge weapons with "Sledge" in the prefab name via Jotunn or late registration)
  • Skips weapons already processed by sledgemajster — no double-processing, no conflicts
  • Does not modify sledgemajster's code or behavior in any way

Technical Details

  • Hooks: None (uses a delayed coroutine, not Harmony patches)
  • Timing: Waits 8 seconds after ZNetScene initialization for all mods to finish registering items
  • Detection: Matches prefab names containing "Sledge" (case-sensitive, excluding "Anchor"), same logic as sledgemajster
  • Attack cloning: Uses MemberwiseClone on the reference attack for a faithful shallow copy

Attributions

  • balrond_sledgemajster by Balrond — the original sledge attack-swap mod that this patch extends
  • balrond_arsenal_reborn by Balrond — adds the Arsenal Reborn sledge weapons that this fix targets
  • BepInEx by BepInEx Team — the modding framework
  • Jotunn by ValheimModding — the Valheim library framework used by Arsenal Reborn for item registration

Source Code

GitHub Repository

Licensed for free use. If Balrond updates sledgemajster to scan at a later lifecycle event, this patch becomes unnecessary and can be safely removed.

Thunderstore development is made possible with ads. Please consider making an exception to your adblock.