InstantTame
Valheim 1.0 ready. Hotkey instantly tames creatures in a set radius. 9 tames normal tameables, 0 force-tames (and untames) monsters like Draugr and Greydwarves.
模組介紹 作者原文
InstantTame
Instantly tame creatures within a configurable radius using a hotkey. Updated for Valheim 1.0 (Unity 6).
Two keys, two behaviors:
- TameKey (default 9): tame-only, for creatures that are naturally tameable (Boar, Wolf, Lox, etc). Never untames anything, so your pets are always safe from this key.
- ForceTameKey (default 0): tame/untame toggle, for creatures that are NOT naturally tameable (Draugr, Skeletons, Greydwarves, Trolls, and anything else running MonsterAI). Press once to force-tame a wild one in range, press again to untame a force-tamed one in range. Normal tameables are completely ignored by this key in both directions.
GUID: YouDied.InstantTame
Requirements
- Valheim 1.0
- BepInExPack_Valheim 5.4.2350 or newer (the 1.0-compatible build)
Default Config
| Setting | Default | Description |
|---|---|---|
| TameKey | 9 (Alpha9, main row) | Tame-only hotkey for normally-tameable species |
| ForceTameKey | 0 (Alpha0, main row) | Tame/untame toggle hotkey for non-tameable species |
| TameRadius | 10 (1-50) | Search radius in meters, shared by both keys |
| TameAllInRadius | false | Act on every eligible creature in range vs. just the nearest one |
| ForceTameCommandable | true | Force-tamed creatures get a Tameable component added so they can be given follow/stay commands. If false, they just stop being hostile with no command support |
Config is adjustable via BepInEx Configuration Manager, no restart required.
How it works
Both keys scan a sphere around the player via Physics.OverlapSphere, filtering out the player and dead creatures.
TameKey (9) targets only creatures that already have a Tameable component and are not already tamed, and invokes its private Tame() method via reflection. This is the exact vanilla flow: MonsterAI.MakeTame(), m_tamedEffect VFX, and the "$hud_tamedone" message. Full parity with natural taming. There is no untame behavior on this key at all.
ForceTameKey (0) targets only creatures without a native Tameable component (tracked internally by ZDOID once force-tamed, since a Tameable may get injected). Behaves as a toggle:
- If an untamed eligible monster is in range, it force-tames the nearest one (or all, if TameAllInRadius). If the creature runs MonsterAI (true for Draugr, Skeletons, Greydwarves, Trolls, etc.), it calls the public MonsterAI.MakeTame() directly, which sets the tamed flag, clears alert state, and drops current targets. Hostility toward the player is gated on Character.IsTamed() checks in MonsterAI.UpdateTarget(), not a faction system, so no faction reassignment is needed. If ForceTameCommandable is on, a Tameable component is added afterward with m_commandable = true so follow/stay works. Creatures with no MonsterAI (e.g. AnimalAI-driven passive animals) fall back to Character.SetTamed(true) directly. Best effort only, no commands, no VFX.
- If no untamed eligible monster is in range but a force-tamed one is, it untames the nearest one instead: reverses SetTamed, removes any injected Tameable, and clears the follow target.
- Untaming only ever applies to creatures this mod itself force-tamed. It will never touch a creature that's naturally tameable, regardless of tamed state.
Both keys are blocked while chat, console, or inventory has focus.
Build
The project uses direct HintPath references only (no NuGet). Everything resolves from your local Valheim install:
- valheim_Data\Managed\ for assembly_valheim.dll, the UnityEngine modules, and Valheim's own netstandard.dll
- BepInEx\core\ for BepInEx.dll and 0Harmony.dll
VALHEIM_INSTALL defaults to C:\Program Files (x86)\Steam\steamapps\common\Valheim. Override it with an environment variable or edit the.csproj if your install lives elsewhere.
Project settings that matter for Valheim 1.0:
- Targets net472 (needs the.NET Framework 4.7.2 targeting pack installed)
- FrameworkPathOverride points at the 4.7.2 reference assemblies
- netstandard is referenced from Valheim's Managed folder (v2.1.0.0) to avoid a ve
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。
下面這些內容需要先安裝,否則該模組不會生效: