HereComesTheVein
Mined copper ore and obsidian have a 20% chance to become iron ore, and obsidian veins can drop bonus iron; mined stone can become a Surtling Core (1%), coal (10%) or tin ore (5%).HereComesTheVein
I use AI to review code and assist with optimization and integrity; I manually test and review every mod, and all decisions and code remain my own.
Current release: 1.2.0
A lightweight Valheim mod by R4V9N1.
HereComesTheVein keeps vanilla copper veins unchanged and gives each generated CopperOre drop an independent 20% chance to become IronOre instead. The remaining 80% stay CopperOre.
Obsidian veins work the same way: each Obsidian dropped by a mined obsidian vein has an independent 20% chance to become IronOre instead. On top of that, each destroyed obsidian vein has a 20% chance to drop 1-3 extra IronOre.
Mining stone works the same way: each Stone dropped by a mined rock has a 1% chance to become a Surtling Core, a 10% chance to become Coal and a 5% chance to become Tin Ore instead.
Behaviour
- Copper vein prefab and world-generation identity remain vanilla.
- Valheim generates the normal mining drop list first, including its normal quantities, drop chances, and resource scaling.
- Each final
CopperOreresult fromMineRock/MineRock5mining receives one independent roll: 20% becomesIronOre, 80% remainsCopperOre. - Replacement is one-for-one, so the total number of ore drops is unchanged; only the obsidian vein bonus adds drops.
- Each final
Obsidianresult from a mined obsidian vein (MineRock_Obsidian) receives one independent roll: 20% becomesIronOre, 80% remainsObsidian. Obsidian vein prefab and world-generation identity remain vanilla. - Each destroyed obsidian vein also receives one bonus roll: 20% chance to add 1-3 extra
IronOreto its drops (the bonus ore is not re-rolled and is not scaled by the world resource rate). - Each final
Stoneresult fromMineRock/MineRock5mining receives one independent roll: 1% becomesSurtlingCore, 10% becomesCoal, 5% becomesTinOre, 84% remainsStone. - Mining drops that are not
CopperOre,ObsidianorStoneremain unchanged. Obsidian from other sources (for example the small obsidian crystals in mountain caves) is not changed. - Unrelated
DropTableusers are not modified. - IronOre does not depend on Elder defeat, trophies, altar state, guardian-power activation, special vein selection, or a special texture.
- Existing worlds are supported because the mod does not regenerate or rewrite world-generation data.
Multiplayer
Install the mod on the server/host and on every client for a matching setup. Valheim's owner-side mining RPC path remains authoritative for generated drops.
Requirements
- Valheim
- BepInExPack Valheim
Manual installation
Copy HereComesTheVein.dll into:
Valheim\BepInEx\plugins\HereComesTheVein\
Removal
Removing the DLL stops the runtime substitution. The mod does not rewrite vanilla copper-prefab identities or persist custom vein state in world data.
Technical approach
The plugin brackets the current owner-side MineRock.RPC_Hit(long, HitData, int) and MineRock5.DamageArea(int, HitData) mining paths and scopes conversion to their exact m_dropItems DropTable. Obsidian veins are not MineRock objects; for them it brackets DropOnDestroyed.OnDestroyed() on MineRock_Obsidian only and scopes conversion to that vein's m_dropWhenDestroyed DropTable; after conversion it rolls the vein's single 20% bonus and appends 1-3 IronOre to that drop list. It patches only the public parameterless DropTable.GetDropList() result. Valheim generates the final list first; the mod then independently replaces each CopperOre and obsidian-vein Obsidian entry with IronOre at a 20% probability, and each Stone entry with SurtlingCore (1%), Coal (10%) or TinOre (5%).
