Valheim

Details

Last Updated
last week
First Uploaded
last week
Downloads
43
Likes
1
Size
143KB
Dependency string
ValheimSkal-ChanceCraft-1.1.6
Dependants

Categories

Description

  • This mod allows you to setup probability of crafting armor, weapons and ammo.
  • With Failiour craft you loose your resources, only one resource at random is given back.
  • When try to upgrade item fails you loose only one resource from recipe.

Join me on discord to report bugs and give me feedback:

Link: https://discord.gg/rKGzYaH4

Chance Craft — README (summary)

Chance Craft is a small Valheim BepInEx plugin that adds a configurable chance for crafting and upgrading weapons, armor, shields and arrows to fail. It also provides optional consumable helper items that temporarily increase the success chance when consumed during crafting.

Key behaviour (short)

  • Adds a success/failure roll to crafting and upgrading of eligible item types:
    • Weapons (one- and two-handed, bows)
    • Shields
    • Armor pieces (helmet, chest, legs)
    • Ammo
  • Base success chances are configurable separately for crafting and upgrading (weapons / armor / arrows).
  • The mod can detect and consume "helper" items in the player's inventory (configurable by prefab name). Each consumed helper adds a configured percent to the success chance for that craft.
  • On success the crafting/upgrading effect is allowed and required resources are removed normally.
  • On failure the mod attempts to revert any changed item quality/variant (undo the partial result) and removes resources according to the failure handling rules (the plugin tries to mimic the game's expected behavior as best it can).
  • The mod displays HUD messages to inform the player when helper items increased chance or when the craft failed.

Notable details & limits

  • The plugin only affects the eligible item types listed above. Other recipe types are left entirely to the game's default behavior.
  • The plugin inspects recipes and only intercepts/suppresses crafting in certain conditions. (Implementation detail: the current logic only intercepts recipes that contain more than one valid resource entry. Recipes with one or zero resource entries are not intercepted — they remain unaffected by Chance Craft and will behave with the game's default outcome.)
  • The plugin attempts to safely handle upgrades (detects upgrade operations and tries to revert or apply changes correctly). Because it uses reflection and best-effort heuristics, behavior may vary across Valheim versions or other mods that change crafting UI internals.
  • The plugin removes consumed helper items by best-effort reflection (it supports multiple inventory removal patterns and falls back to decrementing the item stack when possible).

Configuration

All configuration is in the plugin's config file (BepInEx/config/...). Main options include:

  • General:
    • WeaponSuccessChance (float 0.0–1.0) — base craft success for weapons
    • ArmorSuccessChance (float 0.0–1.0) — base craft success for armor
    • ArrowSuccessChance (float 0.0–1.0) — base craft success for ammo
    • WeaponSuccessUpgrade, ArmorSuccessUpgrade, ArrowSuccessUpgrade — base upgrade success chances
    • Logging Enabled — turn plugin logging on/off
  • ChanceCraft.Line1 .. Line5:
    • increase craft percentage (float 0.0–1.0) — how much this helper increases success (0.05 = 5%)
    • item prefab — Valheim prefab name of the helper item that will be consumed (leave empty to disable that line)

Notes:

  • Multiple matching helper items found will be summed, but the total is clamped to 100% (1.0).
  • Each helper item is removed (one instance) when used to increase chance.

Player messages

  • On success when helper(s) were consumed: shows a centered HUD message like "Percentage increased by X%".
  • On failure: shows "Crafting failed!" (or "Crafting failed even percentage increased by X%" when helpers were used).

Installation

  1. Install BepInEx for Valheim.
  2. Drop the plugin DLL into the BepInEx/plugins folder.
  3. Start the game and edit the generated config file to tune chances and helper prefabs.

Troubleshooting & notes for modders

  • If a particular item or recipe is not affected, check that:
    • The recipe has more than one resource entry (single-resource recipes are currently not intercepted).
    • The result item type is one of the eligible types.
    • The helper prefab name exactly matches the Valheim prefab name configured (the plugin normalizes names but exact prefab availability matters).
  • If you see unexpected behavior, enable logging in the config to get plugin debug output.
  • Because the plugin uses reflection to interface with Valheim internals, updates to the game may require updates to the plugin.

License & credits

  • Author: Deep

Release notes:

v1.1.5

  • updated readme

v1.1.5

  • Added possibility to add 5 items prefabs with percentages.
  • Theese items if in inventory while crafting will be consumed and will increase craft success percentage.

v1.1.4

  • Revision of structure, separation of helpers in separate files.

v1.1.3

  • Added possibility to set percentage for upgrading separatelly

v1.1.2

  • Inicitial release
  • Set probability separately for armor, weapons annd ammo
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.