ArmorMouldDropRates
Configurable drop rates for the nine armour moulds dropped by Krigen and Hexen.ArmorMouldDropRates
Adjusts only nine armour mould entries in the existing CharacterDrop tables of Krigen (JotunWarrior) and Hexen (JotunWitch). Default: triple their base chances, from 3% to 9% and from 5% to 15% respectively.
Verified against the locally installed Valheim 1.0.17, Steam build 25730771. Requires BepInEx 5 and its bundled Harmony; no Jötunn or other loot framework.
Installation
Install BepInExPack_Valheim 5.4.2351 (the version verified in the existing trophy project's local pack). Put ArmorMouldDropRates.dll in Valheim/BepInEx/plugins/ArmorMouldDropRates/. With a mod manager, use the active profile's BepInEx directory.
Multiplayer: install on the dedicated server/host AND every client with identical settings. The creature's owning peer evaluates loot and may be a client. Server-only installation is insufficient. No configuration synchronization or enforcement is added; restart all peers after changing settings.
Configuration
Launch once to create BepInEx/config/com.weizhexu.armormoulddroprates.cfg. Exit, edit, and restart. Defaults:
[General]
Mode = Multiplier
FixedChance = 0.10
Multiplier = 3.0
DebugLogging = false
Mode accepts Fixed or Multiplier, case-insensitively; invalid text warns and falls back to Multiplier. FixedChance clamps to 0–1. Negative Multiplier clamps to zero, and resulting chances cap at 1. Nonfinite values warn and fall back to 0.10 or 3.0. BepInEx handles malformed numeric/Boolean text using its normal defaults. Settings are captured at startup; hot reload/unload is unsupported.
Zero-chance limitation in Valheim 1.0.17: zero is written to the base field as configured, but the game's native pseudo-drop calculation divides by chance without checking zero. Therefore zero is not a verified way to disable drops; the plugin logs a warning for every target assigned zero. Very tiny positive probabilities can also overflow the game's integer countdown conversion. This plugin deliberately does not replace RNG, edit global pseudo-drop state, or patch the per-kill generator. Positive normal-range settings, including both examples below, use the native path directly.
Multiplier example
Mode = Multiplier
Multiplier = 3.0
Multiplies the original existing chance captured at initialization. The observed vanilla values produce:
| Creature | Exact item prefab ID | Vanilla base | Default base |
|---|---|---|---|
| JotunWarrior | MoldArmorGoldChest | 3% | 9% |
| JotunWarrior | MoldArmorGoldHelmet | 3% | 9% |
| JotunWarrior | MoldArmorGoldLegs | 3% | 9% |
| JotunWarrior | MoldArmormediumChest | 3% | 9% |
| JotunWarrior | MoldArmorMediumHelmet | 3% | 9% |
| JotunWarrior | MoldArmorMediumLegs | 3% | 9% |
| JotunWitch | MoldArmorMageChest | 5% | 15% |
| JotunWitch | MoldArmorMageHelmet | 5% | 15% |
| JotunWitch | MoldArmorMageLegs | 5% | 15% |
The Gold set is Protector armour, Medium is Vanguard, and Mage is Caller. The unusual lowercase medium in MoldArmormediumChest is verified, intentional and case-sensitive.
Fixed example
Mode = Fixed
FixedChance = 0.20
All nine targeted creature entries receive a 20% base chance. FixedChance is ignored in Multiplier mode; Multiplier is ignored in Fixed mode.
Scope and native mechanics
Only m_chance changes, in place. Drop lists, entry objects, item prefabs, quantities and all other metadata are retained. Leather straps, Memorial Coal, Nornathread, Intricate Key and trophies are untouched by this plugin. Containers and other sources of the same items are unaffected. Weapon, shield, staff and key moulds, crafting/cast recipes, Frost Foundry behavior, finished armour, spawns and star probabilities are untouched.
The separate prefab JotunWarriorDualWield exists in this installation and is deliberately excluded. Matching is exactly the two specified creature IDs and their respective item sets, never a name-prefix search.
Valheim applies its own pseudo-drop behavior at effective chances <= 30% unless disabled by the game's global setting. Its counter records the effective chance and resets itself when that changes. Larger chances use its ordinary random branch. No custom rolls or counter manipulation are added. Percentages here are base chances, not independent per-kill guarantees.
Krigen's six moulds have m_levelMultiplier = true: vanilla star scaling affects both chance and quantity. Hexen's three have it false. The plugin preserves this difference, along with m_amountMin, m_amountMax, m_onePerPlayer and m_dontScale.
Initialization, logs and compatibility
Uses the same last-priority ZNetScene.Awake postfix as the existing trophy plugin, after prefab registration. Processes each scene once and retains weakly keyed original entry values across scene cycles, preventing 3% → 9% → 27% compounding. There is no per-frame or per-kill plugin work.
Startup logs report both creature discoveries, per-creature found/modified counts, total found (expected 9) and total modified. DebugLogging = true logs every targeted original/result chance and all skipped entries on those creatures, including their metadata. Missing creatures, missing/duplicate target entries, missing components and count mismatches produce warnings without deliberately adding or substituting loot.
Compatible with the workspace's CreatureTrophyDropRate_ExcludeBoss plugin: the processors change different entries and were tested in both orders. That trophy plugin copies its list but preserves non-trophy entry references. Other mods which change the same mould chances before this hook influence the captured baseline; later changes may overwrite it. Arbitrary late registration, custom loot systems, shared mutable drop entries across creature tables introduced by other mods, and hot plugin reload are unsupported. Existing creature instances are not retroactively edited. Future prefab/API changes require revalidation; missing known entries are warned about and never replaced with guessed IDs.
An offline scan found no direct container/loot-component reference to the Protector helmet in the inspected main prefab bundle and its dependencies. This is not proof that no indirect or dynamically configured source exists. The plugin has no container access; see the alternate-source test in TESTING.md.
Build and verify
From the repository root with .NET SDK 8 available:
dotnet build ArmorMouldDropRates/ArmorMouldDropRates.csproj -c Release -p:ValheimInstall="C:/Program Files (x86)/Steam/steamapps/common/Valheim"
dotnet run --project tests-moulds/ArmorMouldDropRates.Tests.csproj -c Release
Alternatively set VALHEIM_INSTALL; override BepInExCore for a mod-manager profile or ValheimManaged for another assembly location. scripts/Build-Moulds.ps1 uses the workspace SDK if present and accepts -ValheimInstall, -BepInExCore, and -Test.
Output: ArmorMouldDropRates/bin/Release/netstandard2.1/ArmorMouldDropRates.dll. Game/BepInEx references are local with copying disabled; no proprietary assemblies are distributed. scripts/Package-Moulds.ps1 packages the built DLL and documentation into dist/ArmorMouldDropRates-1.0.0.zip.
See API-NOTES.md for inspection evidence and TESTING.md for automated coverage and live acceptance steps. A successful offline build does not certify Unity loading or a multiplayer session.
