TroughFoodCompatibility
CoreWoodExtras trough compatibility: accept registered animal foods, feed from mixed inventories, and optionally add crops to selected diets.TROUGH FOOD COMPATIBILITY
ONE TROUGH. DIFFERENT APPETITES.
Stock the feed. Let each animal choose its meal.
Trough Food Compatibility connects CoreWoodExtras feeding troughs with optional modded diets and foods added to creatures after they spawn. CoreWoodExtras 2.2.9, 2.3.0, 2.3.1 and 2.3.2 handle mixed food and registered prefab diets natively; this helper keeps its additional diet choices and collection controls. For the reviewed 2.2.7 and 2.2.8 versions, it also supplies the older mixed-food fix.
Compatibility / v0.1.6
Built against Valheim 1.0.16 with BepInExPack Valheim 5.4.2351. Requires CoreWoodExtras 2.2.7, 2.2.8, 2.2.9, 2.3.0, 2.3.1 or 2.3.2 and ConditionalConfigSync 1.0.9. Install matching helper versions on every client and the dedicated server. Exact reviewed CoreWoodExtras DLLs are checked. CoreWoodExtras 2.2.9, 2.3.0, 2.3.1 and 2.3.2 provide native mixed-food handling; this helper retains optional diets and collection controls.
SUPPORT ME ON KO-FI
If this makes your settlement a little easier to live in, buy me a coffee. Your support helps me spend more time on small improvements and compatibility fixes for modded games. A tip is optional and appreciated. Vercadi
FEED THE HERD / WHAT CHANGES
- Discovers food from registered tameable creature prefabs and active creatures, including diets supplied by taming mods.
- Adds those item prefab names to CoreWoodExtras' trough whitelist. Meat, neck tails and modded crops become eligible when an installed creature actually eats them.
- Allows mixed-food troughs. Each animal still needs an item from its own diet; a boar does not start eating meat simply because meat is stored beside berries.
- Preserves CoreWoodExtras' feeding range, hunger handling, per-item selection, network ownership checks and one-item consumption path.
- Blocks the trough's automatic ground pickup by default, so the larger whitelist does not start collecting valuable dropped meals or materials.
The helper does not replace CoreWoodExtras, add a new trough, increase its capacity or alter taming times. The new raw-meat equivalents are enabled by default: animals eating vanilla boar meat also accept BoneAppetit Raw Pork (rk_pork); animals eating vanilla hare meat also accept Odin's raw hare meat (BOH_RawHare_Meat). Herbivores and cooked-meat-only diets do not gain meat. Missing items are ignored. Existing troughs can use the fix; a new world is not required.
STOCK THE TROUGH / INSTALLATION
- Close Valheim and stop the dedicated server normally.
- Install TroughFoodCompatibility and the dependency versions above in all player profiles and on the server.
- Place a CoreWoodExtras feeding trough within the mod's configured feeding range. Stock food suitable for the nearby animals.
Manual installation: copy plugins/TroughFoodCompatibility from this ZIP into BepInEx/plugins after installing dependencies.
Replacing a manually installed copy? Remove that local entry with the game closed, then install the published package. Keep one TroughFoodCompatibility.dll and retain your config.
Removal: empty added foods from troughs first, close the game and server, and remove this helper everywhere. CoreWoodExtras' own behavior remains: 2.2.9 keeps native mixed feeding, while older versions return to their original restrictions. Food stored in the world is not deleted by this helper, but the original restriction can prevent putting it back.
YOUR SETTINGS
The first launch creates BepInEx/config/vercadi.TroughFoodCompatibility.cfg.
[General]
Enabled = true
Lock server settings = true
Allow trough auto collect = false
[Optional diets]
Creature prefabs = Deer,Boar,Sheep_TW
Extra food prefabs =
Raw meat equivalents = true
Extra food prefabs is empty by default. To opt selected creatures into extra crops, list installed item prefab names separated by commas. Creature prefabs selects the species receiving those additions. Existing diet entries remain. Missing items are ignored; names are case-sensitive. This option is a deliberate diet change, not automatic nutritional classification.
For example, if your pack provides BCA_Tomato, adding that name makes the selected deer, boars and Darkhorn accept that tomato. It does not make other species eat it.
Automatic ground pickup requires both Allow trough auto collect = true here and CoreWoodExtras' own auto-collect option enabled. Keep it off unless you want foods dropped near the trough collected automatically.
Edit the server config while stopped and restart all participants after diet changes. Server settings override client values during the session. The helper does not provide a second range setting; use CoreWoodExtras' feeding and storage settings.
FIELD NOTES / TROUBLESHOOTING
Look for ACTIVE: reviewed trough diets and food discovery registered and Trough food discovery: in BepInEx/LogOutput.log. These confirm registration and discovery, not successful feeding.
An item will not enter the trough: confirm its creature or food prefab has loaded and its current diet contains that item. Creature names and item names displayed in the UI can differ from prefab names. The helper does not treat everything called meat or vegetable as food.
An animal will not eat: check its hunger, diet and CoreWoodExtras range. Alerts and normal feeding conditions still apply. One trough may contain several species' foods, but each animal needs a matching item.
After updating CoreWoodExtras: INACTIVE: trough compatibility was not applied means the reviewed binary or methods no longer match. Original behavior continues. Do not assume the helper is working merely because it appears in the mod list.
CREDITS
Created by Vercadi as an independent compatibility add-on. Thanks to MagicMike for CoreWoodExtras and shudnal for ConditionalConfigSync. Their binaries and game assemblies are not included.
Original code and package icon use the included MIT license. Development used AI assistance. The linked Ko-fi button is Ko-fi's brand artwork.
Enjoying my work? Buy me a coffee on Ko-fi. A useful bug report helps too.



