Selective Pet Protection

v0.2.2·Updated 2025-04-08

Selectively prevent your pets from dying

Screenshots 1 screenshots

About this mod Author’s original text

Selective Pet Protection

This mod is based off of PetProtection ( github).

Rather than protecting all pets, it only protects pets you choose individually to protect. Pets can either be immortal or stunnable, akin to V+'s immortal and essential options. "Immortal" means, that pets will be completely unfazed by damage. "Stunnable" means that rather than dying, pets become stunned for a custom period of time where they will simply freeze in their spot and recover.

I don't think essential/stunnable actually works (anymore) in PetProtection/V+ so I made sure it works for Selective Pet Protection.

Commands

To make a pet immortal or stunnable, you simply rename them with the commands!god or!stun respectively. This will not actually rename the pet, but just add the protection. You can always tell the state of protection by the shield icon after the pets name. By default, gold means immortal, light blue means stunnable. You can change the colors to your liking in the config. Use!none to remove protection.

NEW: You can now toggle the protection with the displayed hotkey (Shift + T by default), when you hover your cursor on the pet.

Configuration

You can change the shield color for immortal and stunnable.

You can set the time a pet will be stunned for.

You can change the hotkey to toggle the protection on hover.

Compatibility

Partial support for VikingNPC. Only toggling via the hotkey (default is Left Shift + T) works. The hotkey tooltip will not show up when you hover over a tamed Viking, but it will still work, apparent by the shield icon. When your Viking is stunned it will also not say "Recovering" when you hover, but it is indeed recovering in the background.

Known Issues

  • When a pet is stunned and there is no other valid target around, the attacker will keep attacking the stunned pet. This has no effects on the pet, but rather than the attacker roaming around, he will be fixated on the pet. This might be somewhat of a fringe case, since usually a player will be around.
  • When stunned, pets might be locked in their current animation und they recovered
  • Non-physical damage can unstun pets.

Contact

magnus.jpg on the Valheim Modding Discord

Changelog

0.2.2 Fixed a Prefix NRE when a Tameable didn't have a Character component (e.g. HardRock)

0.2.1 Partial support for VikingNPC.

0.2.0 Added a hotkey to toggle the protection on hover

0.1.1 Forgot to mention the!none command in the readme

Install & use Install: BepInEx plugin

  1. The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
  2. Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
  3. Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
  4. Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.

Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file. In multiplayer, the host and every client need the same mods installed.

Dependencies

Install these first, or the mod will not work:

denikson-BepInExPack_Valheim

File & checksum

Filename
Selective_Pet_Protection-0.2.2.zip
File size
149.9 KiB