ChanceCraft

版本 v1.1.6·更新於 2025-11-10

Set chances for crafting and upgrading armor, weapons and ammo.

模組介紹 作者原文

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:

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

  • Install BepInEx for Valheim.
  • Drop the plugin DLL into the BepInEx/plugins folder.
  • 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 reci

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

denikson-BepInExPack_Valheim

檔案與校驗

檔案名稱
ChanceCraft-1.1.6.zip
檔案大小
139.7 KiB