You are viewing a potentially older version of this package. View all versions.
DocZee-AnimalFeedGuard-2.0.3 icon

AnimalFeedGuard

Keep animal feed on the ground: prevent automatic pickup near tamed animals that can eat it. Configurable radius, manual pickup preserved, and compatible with AutoPicker's normal pickup path.

Date uploaded a week ago
Version 2.0.3
Download link DocZee-AnimalFeedGuard-2.0.3.zip
Downloads 175
Dependency string DocZee-AnimalFeedGuard-2.0.3

This mod requires the following mods to function

denikson-BepInExPack_Valheim-5.4.2350 icon
denikson-BepInExPack_Valheim

BepInEx pack for Valheim. Preconfigured with the correct entry point for mods and preferred defaults for the community.

Preferred version: 5.4.2350

README

Animal Feed Guard

2.0.3 targets Valheim 1.0, built and checked against 1.0.16. Use the 1.x releases for Ashlands.

Animal Feed Guard keeps dropped food on the ground when a living, tamed animal that can eat it is nearby. Manual pickup remains available.

Features

  • Configurable protection radius: 0-50 metres; default 25 metres.
  • Uses each animal's live food list, including Asksvin Smokepuffs, Deep North feeds, seeds, barley, and modded feed.
  • Measures distance to the animal's body, so a large animal's origin does not leave nearby feed unprotected.
  • Reads synchronized tameness through ownership changes.
  • Protects food even when the animal is already fed.
  • Applies only to automatic pickup; manual pickup is unchanged.
  • Client-side settings; install it on every player's client who wants protection.
  • Compatible with AutoPicker's normal pickup path.

Creature and food coverage

The audit read all 150 MonsterAI components in the installed 1.0.16 asset bundle. Fourteen have nonempty diets, totaling 48 creature/food combinations (including juvenile and summoned variants). Protection uses live consume lists, with no species or biome whitelist. See the audit.

Creature Feed found in installed assets
Asksvin Smokepuffs, vineberries, fiddleheads
Asksvin hatchling Cloudberries, barley, flax; only qualifies if tamed
Hen Dandelions, barley, beech/birch/carrot/onion/turnip seeds
Boar and summoned boar Carrots, turnips, onions, mushrooms, raspberries, blueberries
Wolf and summoned wolf Neck tails, boar/lox/deer/chicken meat, sausages, raw fish
Lox Cloudberries, barley, flax
Deep North moose and summoned moose Lingonberries
Deep North bear variants Blueberries; only qualifies if tamed (including the summoned bear)

These are audited game defaults, not hardcoded lists. Modded additions to an animal's consume list are also recognized. Creatures without any feeding behavior do not protect arbitrary items.

Testing and diagnostics

For regression tests, import the ZIP into a separate Gale profile, replacing the old AnimalFeedGuard DLL. Confirm an empty inventory slot is available when testing; otherwise failure to collect does not prove protection. Compare matching and nonmatching food inside/outside the radius, then repeat with the mod disabled and with AutoPicker enabled.

For the Asksvin test, drop Smokepuffs beside adult tamed Asksvin and run over them. Enable Diagnostics → Log Pickup Decisions in ConfigurationManager (or the config file) to log the protection decision, body/origin distances, and synchronized tame state in BepInEx/LogOutput.log. Turn logging off after the test. Logging is rate-limited per food and outcome and does not write to saves.

Automated coverage passed. The reported Smokepuff was 7.67 metres from the Asksvin's body, outside the former 5-metre radius. The maintainer has tested the current build and confirmed it works as intended. Manual pickup is deliberately allowed. Another player's unmodified client, or a mod that directly inserts items into an inventory, can still collect the feed.

Configuration

The config file is BepInEx/config/com.ziluck.valheim.animalfeedguard.cfg.

Enabled controls the feature. Protection Radius controls the distance from the dropped item to the nearest point on an eligible tamed animal's body collider. This handles large animals such as Asksvin, lox, and moose. A radius of 0 disables protection.

The default is 25 metres. Existing configs retain their saved radius when upgrading; set Protection Radius = 25 to adopt the new default.

Recommended optional mods

  • ConfigurationManager - edit the settings in game instead of opening the config file. It is optional.
  • AutoPicker - optional compatibility; Animal Feed Guard does not require it.

Links

Check out my other mods

  • HenEggPickup - automatically collects chicken eggs once enough adult hens are nearby.
  • RanchingAddon - adds skill-scaled chick and Asksvin hatchling growth, plus growth and egg incubation information to Ranching.

If you'd like to support ongoing modding work, Ko-fi is available.

Requires BepInExPack Valheim. Ranching and AutoPicker are optional.

CHANGELOG

Changelog

2.0.3 - 2026-10-06

  • Share food matching between protection and pickup diagnostics.
  • Add simulated filter checks and tests for diet enumeration, branch labels, and exception boundaries.
  • Include every check project in dependency updates.
  • Maintainer confirmed the current build works as intended in game.

2.0.2

  • Increase the default feed protection radius from 5 to 25 metres.
  • Preserve existing configured radii; set Protection Radius to 25 to use the new default with an existing config.

2.0.1

  • Measure feed protection from the animal's body collider instead of its origin, with an origin fallback.
  • Read synchronized tame state through ownership changes and recheck live creature state and diet for each item.
  • Add optional, rate-limited pickup diagnostics.
  • Audit all installed 1.0.16 feeding prefabs, including Asksvin Smokepuffs and Deep North creatures.
  • Add regression coverage for all 48 creature/food pairs and actual pickup-transpiler IL.
  • Prepare a test ZIP; live regression testing remains pending.

2.0.0

  • Formally target Valheim 1.0; compiled and checked against 1.0.16.
  • Require BepInExPack Valheim 5.4.2350.
  • Add GitHub Actions builds and automatic publication of new versions from main.
  • Add Hexium publishing scaffolding, disabled until DocZee is approved.
  • Keep plugin IDs and configuration files stable for existing installations.

1.0.0

  • Added configurable automatic pickup protection for food near living tamed animals.
  • Match each animal's actual food list, including seeds and modded feed.
  • Preserve manual pickup and normal pickup outside the protection radius.
  • Inspect compatibility with AutoPicker 1.1.3's ground pickup path.
  • Client-side settings; no dedicated-server installation required.

Build and automated code checks passed. Live gameplay testing is still pending.