
OdinBet ForgeOfPotential
Full control over the Refinement Forge: percentage success chance, what failure does, cost, duration, level cap, 16 Idol recipes and server-wide chat announcements.π‘οΈ ODINBET β FORGE OF POTENTIAL
Gamble on your gear. Or lose it.
π¬ Join the Discord
What this mod does
Forge of Potential turns the Refinement Forge into a real gambling table. In vanilla Valheim, refining is a button that sometimes works, and you control almost none of it. With this mod, you set every number: the odds, what happens when you lose, what it costs, how long it takes, how far it can go, and what the whole server gets to hear about it.
Four systems, each one switchable on its own:
| System | What it gives you |
|---|---|
| βοΈ The gamble | Success chance as a percentage, plus separate control over what a failure does: drop levels, destroy the item, or hand it back at level 1. |
| π Recipes | All 16 Idols (Protection and Battle, tier 0 through 7) get craft recipes, each one requiring the boss trophy for that biome. Cost scales with item level. |
| π’ Global Notifications | Every refinement becomes a line in every player's chat. Separate text for success, failure and destruction. |
| ποΈ Forge area | Optional exemption that lets you build inside the protected zone around the Refinement Forge. |
Multiplayer: with the mod installed on a dedicated server, the server
enforces its config values on every client that connects (in memory β nobody's
local .cfg is overwritten on disk). Without the mod on the server, every player
just uses their own .cfg.
β οΈ Read this before installing
This is the first public release (1.0.0).
- A large part of the code was reviewed with AI assistance, including
validating every patch target against the metadata and IL of the game's
assembly_valheim.dll. That caught real bugs, but it is not a substitute for real testing by real players. - In other words: there may be bugs. If you hit one, please report it.
- π Report bugs on Discord: https://discord.gg/aMkN89Cuas
- When reporting, it helps a lot to include your
.cfg, the BepInExLogOutput.log, and what you expected to happen. If you can, turn onVerboseLogging = true(theDebugsection) before reproducing it β it writes exactly what the mod did on every refinement.
Installation
With a mod manager (recommended): install through Thunderstore Mod Manager, r2modman or Gale. BepInEx comes along as a dependency.
Manually:
- Install BepInExPack Valheim.
- Copy
OdinBet_ForgeOfPotential.dllintoBepInEx/plugins/. - Run the game once.
BepInEx/config/OdinBet.ForgeOfPotential.cfgis generated with every option commented. - Edit it and restart.
Dedicated server: same DLL, same BepInEx/plugins/ folder. Installing on
both sides is recommended β that way the server enforces the config and nobody
plays with different numbers.
How the game resolves a refinement (and where the mod steps in)
Worth understanding, because the settings make far more sense afterwards.
target = item's current level + 1
roll = random number between 0 and 1
if (idol's upgrade chance >= roll) -> SUCCESS: item comes back at the target level
else if (idol's break chance >= 1 - roll) -> BROKE: item is gone, some ingredients come back
else -> FAILED: item comes back one level LOWER
Note this: losing a level is already what a normal failure does in Valheim. "Destroying the item" is a separate, rarer branch. The mod does not rewrite that logic β it writes your configured numbers into the right fields before the craft and restores them afterwards. That is the safest possible approach: no game code is rewritten.
π Every setting
File: BepInEx/config/OdinBet.ForgeOfPotential.cfg
Everything is server-synced except VerboseLogging.
π Feature Toggles section
Master switches. Turn a whole system off here if you only want the others.
| Setting | Default | What it does |
|---|---|---|
EnableCustomRecipes |
true |
Adds the craft recipes for all 16 Idols. With false, the mod touches no recipes at all β use this if you only want the gambling, or only the announcements. |
EnableUpgradeChanceAndCostTweaks |
true |
Master switch for the entire Upgrade Settings section (chance, failure, cost, cap). With false, the mod touches none of it and the game's own prefab values are used. |
EnableCraftDurationTweaks |
true |
With false, UpgradeBaseDuration and UpgradeDurationIncreasePerLevel are ignored and the game's own duration is used. |
π² Upgrade Settings section β the gamble
This whole section only applies while
EnableUpgradeChanceAndCostTweaks = true.
The odds
| Setting | Default | Range | What it does |
|---|---|---|---|
UpgradeSuccessChance |
100 |
0β100 or -1 |
Chance, in percent, that a refinement succeeds. 100 = never fails. 0 = always fails. 65 = succeeds roughly 65 out of 100 attempts. -1 = leave the idol's own chance untouched. |
FailureBreaksItemChance |
0 |
0β100 or -1 |
When an attempt fails, what percentage of those failures destroys the item instead of only lowering its level. 0 = never destroys. 100 = every failure destroys. -1 = use the game's own value. |
β οΈ FailureBreaksItemChance is a share of the failures, not of all attempts.
With UpgradeSuccessChance = 80 and FailureBreaksItemChance = 50, the real
outcome is: 80% success, 10% destroyed, 10% level lost.
What a failure does
| Setting | Default | Range | What it does |
|---|---|---|---|
LevelsLostOnFailure |
1 |
0β20 | How many levels the item drops on a failure that does not destroy it. 1 = vanilla (level 5 becomes level 4). 0 = the item keeps its level and the attempt only costs the ingredients. 2 or more = a harsher penalty. |
MinimumLevelOnFailure |
1 |
1β20 | Floor the item can never drop below through failure. Leave this at 1. Without this guard, the game hands back a level 0 item when a level 1 item fails β a bug in Valheim itself. |
FailureAtMinimumLevelBreaksItem |
false |
β | What to do when the item is already at the floor and there is no level left to take. false = it survives and the attempt only cost the ingredients. true = the failure is promoted to a break, and then BreakReturnsItemAtLevel1 / BreakReturnIngredientsPercent decide what the player gets. Ignored while LevelsLostOnFailure = 0. |
What happens when an item is destroyed
| Setting | Default | Range | What it does |
|---|---|---|---|
BreakReturnsItemAtLevel1 |
false |
β | false = vanilla: the item is destroyed and part of the ingredients is refunded. true = the item is not destroyed; the player gets the same item back at level 1 and no materials. |
BreakReturnIngredientsPercent |
-1 |
0β100 or -1 |
How much of the recipe's recoverable ingredients comes back when the item IS destroyed. 0 = nothing, 100 = everything. -1 = use the game's own value. Only matters if something actually breaks. |
π‘ Why you probably want BreakReturnsItemAtLevel1 = true:
refunded materials are metals and ores, and those cannot go through a
portal. A player who fails a refinement far from home is stranded with a pile
of metal and no way back. Handing the finished item back at level 1 keeps the
loss real while letting them portal home.
π Useful combination: FailureAtMinimumLevelBreaksItem = true +
BreakReturnsItemAtLevel1 = true β a level 1 item can never be lost outright;
it just comes back at level 1 and the idol is gone.
Level cap
| Setting | Default | Range | What it does |
|---|---|---|---|
MaxUpgradeLevel |
0 |
0β100 | Highest level an item can be refined to. 0 = no limit. |
MaxLevelReachedMessage |
(text) | β | Centre-screen warning shown only to the player who tried. Not broadcast. Empty = no message. |
Valheim deliberately skips its own max-quality check when the station is an upgrader, so without this mod there is no ceiling at all at the Refinement Forge.
β οΈ Honest caveat: the craft button in the UI stays enabled. The block happens on the click β nothing is consumed, but the button is not greyed out. Greying it out would mean patching the game's crafting UI, which breaks far more easily on a game update.
MaxLevelReachedMessage placeholders: {ItemName}, {Level} (the item's
current level), {MaxLevel}.
Ingredient cost scaling
The idol cost can grow as the item gets higher.
| Setting | Default | What it does |
|---|---|---|
CostStart |
1 |
Base idol cost per refinement. (Game default: 1) |
CostIncreasePerInterval |
1 |
How much the cost goes up each time the interval is reached. |
CostIncreaseInterval |
2 |
Number of levels between each cost increase. 0 disables scaling. |
CostScalingLevelStart |
6 |
Level at which scaling starts. Anything below 1 is set to 1. |
Example with the defaults (starts at 6, +1 every 2 levels): levels 1β5 cost 1 Β· levels 6β7 cost 2 Β· levels 8β9 cost 3 Β· and so on.
Craft duration
| Setting | Default | What it does |
|---|---|---|
UpgradeBaseDuration |
2 |
Base refinement duration, in seconds. (Game default: 8) |
UpgradeDurationIncreasePerLevel |
1 |
Extra seconds per item level. (Game default: 1) |
π¨ Crafting Station section
| Setting | Default | What it does |
|---|---|---|
GlobalStation |
$piece_artisanstation |
Station required to craft all the Idols. Accepts the station's m_name (e.g. $piece_workbench) or its prefab name. Empty = craftable by hand. |
π Recipes section β the 16 Idols
The 16 Idols (Upgrader0Armor β¦ Upgrader7Weapon) already exist in Valheim 1.0.
This mod only adds craft recipes for them.
Format for each recipe: PrefabName:Amount, comma-separated.
| Tier | Idol | Default recipe | Boss / Biome |
|---|---|---|---|
| 0 | Wooden Protection / Battle Idol | FineWood:20, Tin:10, GreydwarfEye:10, TrophyEikthyr:1 |
Eikthyr β Meadows |
| 1 | Bronze Protection / Battle Idol | Bronze:10, SurtlingCore:1, TrophyTheElder:1 |
The Elder β Black Forest |
| 2 | Iron Protection / Battle Idol | Iron:10, ElderBark:5, TrophyBonemass:1 |
Bonemass β Swamp |
| 3 | Silver Protection / Battle Idol | Silver:10, FreezeGland:5, Obsidian:5, TrophyDragonQueen:1 |
Moder β Mountain |
| 4 | Black Metal Protection / Battle Idol | BlackMetal:10, Needle:2, Tar:5, TrophyGoblinKing:1 |
Yagluth β Plains |
| 5 | Black Marble Protection / Battle Idol | BlackMarble:20, BugMeat:10, Carapace:10, TrophySeekerQueen:1 |
The Queen β Mistlands |
| 6 | Flametal Protection / Battle Idol | FlametalNew:10, CharredBone:15, TrophyFader:1 |
Fader β Ashlands |
| 7 | Bloodgold Protection / Battle Idol | Gold:10, Coins:40, FrozenKingDrop:1 |
Kall β Deep North |
That is 16 entries in the .cfg, one per idol: Wooden Protection Idol,
Wooden Battle Idol, Bronze Protection Idol, and so on through
Bloodgold Battle Idol.
π― Every tier requires the boss trophy. That is on purpose: refining gear of a given tier should mean you beat the boss of that tier.
β οΈ About tier 7: Valheim 1.0 ships no head trophy for the Deep North boss
(Kall). What he drops reliably is FrozenKingDrop (Sacrificial Blood), and that
is what went into the recipe. If a future update adds a TrophyFrozenKing, just
swap it in the .cfg.
π‘ Two practical notes:
- Boss trophies also unlock powers at the Sacrificial Stones. Spending one on an idol consumes it β but bosses can be summoned again and trophies stack to 20.
- If a prefab name does not exist in your build, the mod logs a warning and builds the recipe without that ingredient instead of cancelling the whole recipe. Worth checking the BepInEx log the first time you run it.
ποΈ Refinement Forge Area section
| Setting | Default | Range | What it does |
|---|---|---|---|
AllowBuildingNearRefinementForge |
false |
β | Lifts the no-build restriction around the Refinement Forge β the one that answers "a mystical force prevents building". |
RefinementForgeBuildRadius |
32 |
1β256 | How far the exemption reaches, in metres, from an upgrader crafting station. |
How the exemption works, and why it is safe: it is not based on the location's name. The mod checks whether a crafting station flagged as an upgrader exists within the radius of the spot being built on. That is exactly the Refinement Forge and never a boss altar. Altars, crypts and every other protected location keep their protection.
β οΈ Two honest caveats:
- This also allows terrain modification in that area (the game uses the same check for both).
- If the Refinement Forge can be built by players, a large radius turns into a portable "build anywhere" bubble. That is why the default is 32, not 200.
π¬ Local Messages section β centre-screen text
These are the messages only the player who refined sees, in the middle of the screen.
| Setting | Default | What it does |
|---|---|---|
ReplaceGameUpgradeMessages |
true |
Swallows the game's own text and shows one from the mod instead. false = leave the game's text exactly as it is. |
LocalSuccessMessage |
(text) | Success. |
LocalFailedMessage |
(text) | Failed and the item lost levels. |
LocalBrokenMessage |
(text) | Failed and the item was destroyed. |
LocalResetMessage |
(text) | Failed, but the item came back at level 1. |
Placeholders: {ItemName}, {Level} (the level that was attempted),
{PreviousLevel}, {ResultLevel} (the level the item actually ended up at).
Why this is worth leaving on, even if you like the game's wording:
- Some Valheim 1.0 builds ship without a translation for those tokens and show
a raw
[msg_upgrader_failed]on screen instead of a sentence. - The game writes its text before the mod has finished deciding the
outcome. With
BreakReturnsItemAtLevel1or aLevelsLostOnFailureother than 1, the game's wording no longer matches the item the player actually received. The mod's text does.
π’ Global Notifications section β server-wide
Every refinement becomes a line in every player's chat.
| Setting | Default | What it does |
|---|---|---|
EnableGlobalUpgradeNotifications |
true |
Turns the whole system on or off. |
NotifyOnSuccess |
true |
Announce successful refinements. |
NotifyOnFailure |
true |
Announce failures where the item only lost levels. |
NotifyOnBreak |
true |
Announce failures that destroyed the item (or returned it at level 1). |
MinimumLevelToNotify |
1 |
Only announce if the attempted level is at least this. 1 announces everything; raise it to 4, say, to keep low-level refinements out of chat. |
SuccessMessage |
(text) | Chat line on success. |
FailedMessage |
(text) | Chat line on a failure with level loss. |
BrokenMessage |
(text) | Chat line when the item is destroyed. |
ResetMessage |
(text) | Chat line when the item came back at level 1. |
Placeholders: {PlayerName}, {ItemName}, {Level} (attempted level),
{ResultLevel} (final level).
π Security detail: what travels over the network is structured data only
(player name, item token, levels, outcome) β never a finished sentence. Every
client renders the text locally. That means two good things: the item name shows
up in each player's own language, and nobody can broadcast arbitrary text
by editing their own .cfg.
π Debug section
| Setting | Default | What it does |
|---|---|---|
VerboseLogging |
false |
[Local β the one setting the server does NOT sync] Writes two lines to the BepInEx log per refinement, with the levels before and after, the outcome, and the chances that were applied. |
Turn this on if a result does not match what your .cfg says. The log shows:
Refine start: 'SwordIron' level 4 -> 5, upgraderResource=True, successChance=50%, ...
Refine result: 'SwordIron' 4 -> 3 (LevelLost) [game text replaced: "..."]
If the Refine result line does not appear, the mod's hooks are not running
at all β the problem is the patch, not the config. Those two lines are the most
useful thing you can attach to a bug report on Discord.
π§© Ready-made config presets
Hardcore (a real gamble):
UpgradeSuccessChance = 50
FailureBreaksItemChance = 25
LevelsLostOnFailure = 1
BreakReturnsItemAtLevel1 = true
FailureAtMinimumLevelBreaksItem = true
Painless (only the cost matters):
UpgradeSuccessChance = 100
FailureBreaksItemChance = 0
LevelsLostOnFailure = 0
Risky, but I never lose the item:
UpgradeSuccessChance = 70
FailureBreaksItemChance = 0
LevelsLostOnFailure = 1
MinimumLevelOnFailure = 1
Just the Idol recipes, nothing else touched:
EnableUpgradeChanceAndCostTweaks = false
EnableCraftDurationTweaks = false
EnableGlobalUpgradeNotifications = false
EnableCustomRecipes = true
Compatibility and known limitations
- Valheim 1.0 with BepInEx 5.
- Client and server need the same mod version. The sync packet carries a protocol number; mismatched versions simply ignore the packet (with a log warning) instead of reading the wrong format β nobody gets disconnected, but the config is not enforced either.
MaxUpgradeLeveldoes not grey out the craft button; it blocks on the click.- The whole refinement is resolved on the client β that is how Valheim is
built. Config sync makes the server enforce its values in memory, which covers
someone editing their
.cfg, but not someone running a modified DLL. - Cost scaling affects any recipe requirement flagged as an upgrader resource. In practice, only refinement recipes carry that flag.
- Without the mod on the server, none of this changes: every client just uses
its own
.cfg.
Inspiration
Inspired by ReforgedPotential by akuichi.
This mod adds a global announcement system, full percentage control over outcomes, a level cap, on-screen message replacement, forge-area build exemption, and its own server-side configuration synchronization.
Found a bug? Got an idea? Want to show off a refinement that went horribly wrong?
π¬ https://discord.gg/aMkN89Cuas