Mods / Cuniculture

Tags:
Food QoL Tweak
Author:
Ghaelen
Side:
Both
Created:
Apr 3rd 2025 at 5:18 PM
Last modified:
Jul 31st at 11:43 AM
Downloads:
16298
Latest release (for Vintage Story 1.22.3 - 1.22.5, potentially outdated):
Cuniculture-1.22.3_1.25.2.zip  1-click install

Description

For questions, comments, bug reports, or suggestions you can journey to Ghaelen's Workshop.

None of the hare's foods could be placed in troughs.  Originally, this mod allowed you to feed your hares with small troughs without resorting to throwing loose vegetables on the ground.  Since then, vanilla Vintage Story has implemented the small trough feeding of hare food, but it's still incomplete.

New Foods

Dry grass, berries (all variants), and fruit mash (all variants) have been added to the hare's diet.  You can even use these new foods to bait vanilla traps for hares (not Primitive Survival, yet).  Additionally, since fruit mash is concentrated and sweeter, they will be drawn to fruit mash baited traps much stronger than other foods.

Small Trough Additions

Since the bad old days, the game has put much of the hare's diet on the allowed-list 

 

In the vanilla game we toss vegetables into a pen and the hares will eat, inducing them to breed.  That's OK, and it still works.  But it's inconvenient (I always seem to accidentally pick the vegetables back up) and messy.  And really, why not use a trough?  If the small trough is small enough for a hen or even a chick, why not a rabbit?

Moreover, rabbits are ravenous for grass and berries.  Grass provides crucial digestive functions and berries are one of a rabbit's favorite desserts.

I do plan on supporting the mod.  If you don't see a mod version for your game version, ping me on Discord at caffeineNYC.  If I ever feel that I don't have the time or energy to support the mod, I will happily transfer ownership to someone else or add them to the "Team Members" list.

PetAI Integration (to be released)

Spoiler!

I had chased the little long-eared rogues from dawn till nigh unto dusk, and never laid so much as two fingers upon one of them.

By my troth, I was made a fool of by hares.

They sprang from tuft to tuft, vanished through grass, slipped ’neath bramble, and mocked me with their white tails flashing like scraps of linen in the wind.  I had set snares badly, crept softly, lunged boldly, and cursed most piteously.  Yet ever they were swifter than my hands, wiser than my feet, and better acquainted with the earth than I.

At last, spent past all pride, I stumbled into a patch of wild growth and fell upon the ground like a sack of turnips. There I lay, panting, sore in every limb, and full of bitter thoughts.

“God’s wounds,” quoth I, “I am beaten by rabbits.”

My belly then made answer louder than my wit, and I fumbled in my poor bag for such berries as I had gathered that morning from a wild bush by the ditch. They were small things, dark and sweet, and I ate them as a beggar eateth: with no ceremony, and much thankfulness.

Then came the marvel.

From the grass before me peered a little leveret, scarce more than a puff of fur with ears. It looked upon me, and I looked upon it. I moved not, for in truth I had no strength left to move. The small creature crept nearer, then halted, then turned aside, then came again, as though fear and hunger did pull at it by contrary strings.

Another came after. Then a third.

They made a shy dance about me, hopping forth and back, sideways and near, as if the very field had grown curious. I held my breath. One bold little thing came so close I could see its whiskers tremble.

Softly, slowly, I took a berry betwixt my fingers and held it forth.

The hare stretched its neck, snatched the berry from my hand, and leapt back as though it had stolen treasure from a king.

I laughed then, but gently, lest I frighten them.

“Well now,” said I, “all day have I chased thee, and thou wouldst none of me. Yet when I sit my weary bones upon the earth and share my poor supper, thou comest like a neighbor to my door.”

One by one they came, timid still, yet trusting by little measures. I gave them berries, and they took them from my hand. Not caught. Not trapped. Not conquered.

Welcomed.

And there, with dirt upon my knees and shame upon my pride, I learned a thing no hunter’s snare had taught me: a hare is not won by haste, nor by hunger, nor by grasping hands.

Thou must sit still.

Thou must be patient.

And thou must have foodstuff.

Realistic Food for Hares

As in real life, hares will now eat dry grass and all variants of fruit mash.

Small Trough Contents

Anything that hares eat can now be placed in the small troughs instead of being unceremoniously tossed into a pen.  You can add bellpepper, cabbage, carrot, dry grass, parsnip, pumpkin, turnip, and all the variants of fruit mash to the small trough to feed your hares.

Preferred Foods and Baited Traps

Hares now have preferred foods, which is reflected in the effectiveness of baited traps.  Grass and turnips are OK, but if you bait a trap with a carrot, rabbits are more attracted to the bait.  Put some loose berries in the trap, and the bait becomes even more effective in catching a hare's attention.  Fruit mash, being concentrated and giving off a stronger, more intense sweet odor than berries, is the most effective bait of all.

For math nerds...

Spoiler!

Catching a hare with a baited trap follows a binomial distribution.  That is, if X is a random variable representing catching the hare, then X ~ Binomial(n, p) where n is the number of trap triggers and p is the catch chance.  If you set up a large number of baited traps, the chances of catching a hare asymptotes to a Gaussian distribution.  Baits attract hares at 50% effectiveness.  A nice juicy carrot attracts at 70% effectiveness.  Sweet loose berries have effectiveness of 75% and fruit mash, which is basically rabbit catnip, 80% effectiveness.

The binomial distribution has a mean of n*p and standard deviation of sqrt(n * p * (1 - p)), so for 50 trap-trigger events:

  • Normal foods should net you 25 catches with a standard deviation of 3.5.
  • Carrots should net you 35 catches with a standard deviation of 3.2.
  • Berries should net you 37.5 catches with a standard deviation of 3.1.
  • Fruit mash should net you 40 catches with a standard deviation of 2.8.

 

This ignores failed trappings where the traps are set off, but bait is consumed anyhow.  Just keep in mind that hare eatTime is 2.3 hours with a min cooldown of 1 hour and max cooldown of 4 hours, so even though fruit mash has an effectiveness of 80% in attracted hares, don't expect a conveybelt of hares!

Fruit Mash Mechanics

Before, your troughs had to be dedicated to a single type of fruit mash.  If you put cherry mash into a trough, you couldn't put anything but cherry mash into it until the trough emptied.  Realistically, you should be able to toss any mixture of fruit mashes into the trough and just have them sit in the trough, together, regardless of what kind of fruit they came from.

Well, now you can!  Small troughs can now take any combination of fruit mash.  You can fill them up with fruit mash of any variety in any combination.

TODO

 

Spoiler!
  • Berries are on the hare's food list but they're not placeable in the small trough (their mash, yes, but not berries themselves).  Oops!  I can accomplish this with a simple json patch, but I'd like to do the same thing with berries that I did for fruit mash: you should be able to just put any and all kinds of berries into the trough and not have to worry about not putting rasperries into a trough that already has pears, for example.
  • Primitive Survival compatibility.  That mod uses its own capture system while we use vanilla logic.  This means a) deadfalls can't be baited with fruit mash, and b) deadfalls don't get an attractiveness buff when baited with carrots or berries.  I'm actually OK with this since I think rabbits are better as a breeding animal than a food animal.  Plus, deadfalls kill their target, I don't want anyone using my code to kill cute, sweet, defenseless bunny rabbits.  If anyone asks for it, I'll work on Primitive Survival compatibility.

 

Questions and Answers

How can I report a problem?

Spoiler!

Before you report a problem, please clear your cache first.  Here's how to do it but if you need more help, reach out to me on Discord:

 

  1. Stop your server completely.
  2. Go to ./data/Cache/unpack/
  3. Delete any Cuniculture-* folders there.
  4. Make sure only one Cuniculture zip is in the server Mods folder.
  5. Start the server again.
  6. Try to reproduce your problem.

 

If the problem disappeared, congratulations!  If the problem persists, go on to the next step:

  1. Make sure your server and client are both running Cuniculture 1.23.0 or newer.
  2. Open caffcuniculture.json and set debugDiagnostics to true.
  3. Restart the dedicated server, or fully restart the game if playing singleplayer/local-hosted.
  4. Reproduce the issue.
  5. Send me server-main.log from that same session.
  6. If there was a crash or client-side issue, send client-main.log too.

 

I can be reached at caffeineNYC on Discord.

What is the provenance of the game?

Spoiler!
This mod is based on a content-only mod by Aristine.  The mod had problems (e.g. the cabbage code had a typo and didn't work, so I fixed it.  His mod seemed abandoned, so I forked it, and cut my teeth on mod authoring, teaching myself how to mod Vintage Story with this relatively simple mod.  I've been adding enhancements and complexity ever since.  1.22.0 had major restructuring of assets, so I cut my teeth on spelunkering through game assets on that version.  Finally, in 1.22.3, I added my first "code mod" piece to the mod.  The rest is history...

Mod Version Mod IdentifierFor Game version Downloads Released Changelog Download 1-click mod install*
1.25.2 caffcuniculture
1.22.3 - 1.22.5
1078 Jul 31st at 11:43 AM Cuniculture-1.22.3_1.25.2.zip 1-click install

Interesting.  Thanks for mentioning this -- it was a good learning lesson for me.

 

So, as you know, Cuniculture adds Harmony patches to allow certain foods that are on the hare's diet that are _not_ trough placeable, to be trough placeable.  In the bad old days, that was everything that the hare ate.  These days, the mainstays are all trough placeable, but there's still an awful lot that hares eat that you can't place in a trough, like mushrooms.  My code assumes the trough has complete and correct food information about its contents.  I strongly suspect that in your save, one of your troughs doesn't.  For whatever reason, one of your troughs has stale / invalid / missing info.  Not sure which.  Maybe it was a mod, maybe a bug in the game.  Who knows.  Because what vanilla VS does is it looks at the trough contents and if it doesn't like what it sees (stale / invalid / missing info) it silently says "OK, that trough does not have valid food in it."   Your game doesn't crash, but also, your animals can't feed off that trough.

You _could_ verify that by breaking all your troughs and refiling them, but that's too much work (although you still may want to try it, because I'm guessing one of your troughs is no longer feeding your animals).

Vanilla VS would ignore the trough, but Cuniculture's patch ran first, saw trough food info that didn't make sense, and ... well, you know what happened.

 

Now for the spam.

 

Nearby animals (I imagine you have more than one animal in the pen, or at least you have pens that are close to each other?  I guess it doesn't have to be because animals will spawn nearby anyhow) constantly ask VS "Can I eat from this?  Can I eat from this?"  So every hen, rooster, hare, goat, etc. tried eating from the bad trough, causing the spam messages, which not only spams the logs, but also slows the game down.

I think the thing to do is:

  • If the trough is bad in any way at all -- stale, invalid, incomplete -- let vanilla Vintage Story handle it (just realize your trough will stop working).  I'm going to log when that happens in server-main, but make sure the log is only written once, otherwise, you're going to get a bazillion copies of the same message in server.main.  But if you don't look at server.main, you're never going to know there's a bad trough.
  • For vanilla items and non-wildcard items, just let vanilla VS handle the requests.

 

As I mentioned, it's possible that the entity physics profile is increased by the log spamming, but just realize that this includes ALL entities in your entire (chunk loaded) world.  Not just Cuniculture.  I don't know if you're playing single player or on a multi-person server, but 44.90 ms is not just Cuniculture.  It's every loaded entity, everywhere, doing everything.  So while the log spamming didn't help, you'd expect this number to be high, especially when there's a lot of "stuff" going on.

The next release of Cuniculture will have the fix in it.

 

Again, thanks for bringing this to my attention.

1.25.1 caffcuniculture 775 Jul 13th at 10:47 PM Cuniculture-1.22.3_1.25.1.zip 1-click install
  • Cuniculture no longer requires PetAI to load.
  • Removed the PetAI metadata dependency and assembly reference.
  • Removed the old baby hare PetAI taming behavior patch from the main release line.
  • Existing hare diet and trough feeding support remains in place.

 

All that stuff is now in a separate git branch.

1.25.0 caffcuniculture 126 Jul 13th at 12:24 PM Cuniculture-1.22.3_1.25.0.zip 1-click install

Small trough feeding audit for Vintage Story 1.22.3.  It almost certainly works on 1.22.2, but I haven't checked that thoroughly.

When this mod was created, very few of the hare foods were placeable in small troughs.  Originally, this mod supported hare farming by a) making hare foods placeable in small troughs, and b) adding realistic IRL hare foods to the hare diet.  Since then, VS has changed significantly, and a lot of what this mod did is now part of the vanilla VS Survival mechanics.  I have finally gotten around to making a complete audit of what hares eat, when, and how.  Foods that are now correctly handled by the vanilla game have been removed from the mod.  However, during my audit, I also found there are new foods that are in the hare diet, and are not placeable in the small trough.  This update corrects both these situations.

  • Removed Cuniculture's duplicate small-trough JSON entries for foods that vanilla now already supports.
  • Added small-trough support for vanilla hare foods that hares can eat but vanilla troughs still do not accept: fennel, olive, cassava, soaked cassava, dried cassava, cooked cattail root, cooked papyrus root, and harvested mushrooms.
  • Harvested mushrooms use one generic mushroom trough texture and a wildcard block-content fix so hares can eat them from troughs correctly.  This had to be done through code.
  • Kept existing Cuniculture dry grass and combined fruit mash trough support.

 

TODO:

  • PetAI Support
    • I can do this already but I want to modify the vanilla PetAI taming mechanic, and that's proving to be slightly difficult.
  • Implement berries.
  • Implement Cuniculture lore books that can be found in the world and traders that documents hare mechanics through rich story telling.
1.23.0 caffcuniculture 1269 Jun 29th at 11:23 AM Cuniculture-1.22.3_1.23.0.zip 1-click install
  • Now that we're a code mod, it's obvious I need debugging help.   A debug variable was implemented to write various things to the logs that will be useful when people report problems.
  • Config Lib support was added to make it easier to switch to debug mode.
  • Some mod (I don't know which as of right now) was modifying the TrapAnimal transpiler, causing Cuniculture to issue a warning and the food preference mechanic to fail.  Cuniculture now transforms TrapAnimal sooner, so the error message should go away, but without knowing which mod we were conflicting with, it's impossible to tell if a) Cuniculture's TrapAnimal is overwritten, making the food preference mechanic fail silently, b) the other mod's mechanic fails, or c) everything is copacetic and works as expected.  In any event, we know transform AnimalTrap earlier, so at least you won't see an error message from us!  :-P
1.22.8 caffcuniculture 923 Jun 20th at 11:55 AM Cuniculture-1.22.3_1.22.8.zip 1-click install

Added the concept of "preferred foods" to the hare's food list.  Their preferred foods make them better / more effective in baited traps.  Carrots have a higher chance of attracted hares to a trap.  Berries have a higher chance still.  Fruit mash, being concentrated and having the strongest odor, is the most effective food for baiting traps.

This is for reed and basket traps.  Primitive Surival uses its own trapping system, so a) fruit mash can't be used with Primitive Survival's deadfall traps, and b) carrots and berries aren't more effective for Primitive Survival's deadfall traps, either.

On the other hand, deadfalls kill the animal, and I hate the idea of anyone using my code to kill cute defenseless bunny rabbits.

1.22.7 caffcuniculture
1.22.2 - 1.22.3
207 Jun 20th at 2:34 AM Cuniculture-1.22.3_1.22.7.zip 1-click install

Before, your troughs had to be dedicated to a single type of fruit mash.  If you put cherry mash into a trough, you couldn't put anything put cherry mash into that trough until the trough emptied.  But that's not really realistic, is it?  The reality is, you should be able to toss any mixture of fruit mashes into the trough and just have them sit in the trough, together, regardless of what kind of fruit they came from.

Well, now you can!  Small troughs can now take any combination of fruit mash.  You can fill them up with fruit mash of any variety.  Huzzah!

1.22.3 caffcuniculture
1.22.2 - 1.22.3
1130 Jun 2nd at 11:00 AM Cuniculture 1.22.3_1.22.3.zip 1-click install

No changes.  Just bumped the version.

1.22.2 caffcuniculture 1353 May 19th at 12:09 PM Cuniculture 1.22.2_1.22.2.zip 1-click install

1.22.2_122.2
Dependency updated to get rid of pesky "potentially outdated" message on VSModDB and to show the mod isn't abandoned.

1.22.0 caffcuniculture
1.22.0-pre.1 - 1.22.1
921 Apr 30th at 1:42 PM Cuniculture-1-22.0_1.22.0.zip 1-click install
  • Male and female hares were combined into "hare-adult.json".
  • The location of hare-adult.json and hare-baby.json was changed to game:entities/animal/mammal/.
  • The modid is now case sensitive and must be lowercase.

 

For the above three reasons, the mod completely stopped working.  All were updated and everything should work now.  Additionally:

 

  • I added a modicon.png so there should be a cute picture of bunnies when you look at the list of loaded mods.
  • Added a previously missing README.md from the mod zip file.
  • Preference weights were added to the foods.  Rabbits now strongly prefer fruitmash with a weight of 90% as opposed to grass which they prefer with a 10% weight (I mean, who wouldn't prefer fruitmash, amirite?)
1.0.10 caffCuniculture 3563 Jun 22nd 2025 at 2:46 PM Cuniculture-1.20.12_1.0.10.zip 1-click install

Nothing to report.  Just modinfo change.

1.0.9 caffCuniculture
1.20.8-rc.1 - 1.20.11-rc.1
1103 May 12th 2025 at 2:29 AM Cuniculture-1.20.11_1.0.9.zip 1-click install

Nothing changed

1.0.8 caffCuniculture 3536 Apr 3rd 2025 at 5:36 PM Empty Cuniculture-1.20.7_1.0.8.zip 1-click install
1.0.7 caffCuniculture 94 Apr 3rd 2025 at 5:36 PM Empty Cuniculture-1.20.6_1.0.7.zip 1-click install
1.0.6 caffCuniculture
1.20.5-rc.1 - 1.20.5
95 Apr 3rd 2025 at 5:35 PM Empty Cuniculture-1.20.5_1.0.6.zip 1-click install
1.0.5 caffCuniculture
1.20.4-rc.1 - 1.20.4
125 Apr 3rd 2025 at 5:28 PM Empty Cuniculture-1.20.4_1.0.5.zip 1-click install

26 Comments (oldest first | newest first) (threaded | flat)

ChimMAG, Aug 3rd at 5:10 AM

I updated the Russian translation.

Ghaelen , Aug 3rd at 10:24 PM
@ChimMAG: I updated the Russian translation.

Awesome!   I humbly thank you!  Would you like me to include this in Cuniculture?   Or do you want to keep this in your Russian Translation mod?

ChimMAG, Aug 4th at 3:35 AM
@Ghaelen: Awesome! I humbly thank you! Would you like me to include this in Cuniculture? Or do you want to keep this in your Russian Translation mod?

When a mod already includes an up-to-date translation, I exclude it from my mod. My mod is simply a tool for adding up-to-date translations more quickly, before the developer adds them. Or, in cases where there is no translation at all (or one that is very old and no longer being updated).

Vesk, Jul 31st at 12:37 PM

Bnnuy🐇

Lisiralei, Jul 31st at 4:43 AM

This mod spams errors like these in my logs, and it seems to make my game run much worse.

 

Errors
31.7.2026 08:20:09 [Warning] Exception while ticking entity Hen (EntityAgent) at XYZ: 511687,08832256496/185/511868,8751, YPR -2,6927452/0/0, Dim 0: 
31.7.2026 08:20:09 [Error] Exception: Object reference not set to an instance of an object.
   at Cuniculture.WildcardBlockTroughContentPatch.Prefix(BlockEntityTrough __instance, ContentConfig config, ItemStack& __result)
   at Vintagestory.GameContent.BlockEntityTrough.ResolveWildcardContent_Patch2(BlockEntityTrough this, ContentConfig config, IWorldAccessor worldAccessor)
   at Vintagestory.GameContent.BlockEntityTrough.IsSuitableFor(Entity entity, CreatureDiet diet) in VSSurvivalMod\BlockEntity\BETrough.cs:line 117
   at Vintagestory.GameContent.POIRegistry.GetNearestPoi(Vec3d centerPos, Single radius, PoiMatcher matcher) in VSEssentials\Systems\POIRegistry.cs:line 196
   at Vintagestory.GameContent.AiTaskSeekFoodAndEat.ShouldExecute() in VSEssentials\Entity\AI\Tasks\AiTaskSeekFoodAndEat.cs:line 131
   at Vintagestory.GameContent.AiTaskManager.StartNewTasks() in VSEssentials\Entity\AI\AiTaskManager.cs:line 456
   at Vintagestory.GameContent.AiTaskManager.OnGameTick(Single dt) in VSEssentials\Entity\AI\AiTaskManager.cs:line 139
   at Vintagestory.GameContent.EntityBehaviorTaskAI.OnGameTick(Single deltaTime) in VSEssentials\Entity\AI\BehaviorTaskAI.cs:line 126
   at Vintagestory.API.Common.Entities.Entity.OnGameTick_Patch2(Entity this, Single dt)
   at Vintagestory.Server.ServerSystemEntitySimulation.TickEntities(Single dt) in VintagestoryLib\Server\Systems\World\EntitySimulation.cs:line 245
31.7.2026 08:20:10 [Warning] Exception while ticking entity Rooster (EntityAgent) at XYZ: 511688,87841036817/185/511868,8751, YPR -2,6878843/0/0, Dim 0: 
31.7.2026 08:20:10 [Error] Exception: Object reference not set to an instance of an object.
   at Cuniculture.WildcardBlockTroughContentPatch.Prefix(BlockEntityTrough __instance, ContentConfig config, ItemStack& __result)
   at Vintagestory.GameContent.BlockEntityTrough.ResolveWildcardContent_Patch2(BlockEntityTrough this, ContentConfig config, IWorldAccessor worldAccessor)
   at Vintagestory.GameContent.BlockEntityTrough.IsSuitableFor(Entity entity, CreatureDiet diet) in VSSurvivalMod\BlockEntity\BETrough.cs:line 117
   at Vintagestory.GameContent.POIRegistry.GetNearestPoi(Vec3d centerPos, Single radius, PoiMatcher matcher) in VSEssentials\Systems\POIRegistry.cs:line 196
   at Vintagestory.GameContent.AiTaskSeekFoodAndEat.ShouldExecute() in VSEssentials\Entity\AI\Tasks\AiTaskSeekFoodAndEat.cs:line 131
   at Vintagestory.GameContent.AiTaskManager.StartNewTasks() in VSEssentials\Entity\AI\AiTaskManager.cs:line 456
   at Vintagestory.GameContent.AiTaskManager.OnGameTick(Single dt) in VSEssentials\Entity\AI\AiTaskManager.cs:line 139
   at Vintagestory.GameContent.EntityBehaviorTaskAI.OnGameTick(Single deltaTime) in VSEssentials\Entity\AI\BehaviorTaskAI.cs:line 126
   at Vintagestory.API.Common.Entities.Entity.OnGameTick_Patch2(Entity this, Single dt)
   at Vintagestory.Server.ServerSystemEntitySimulation.TickEntities(Single dt) in VintagestoryLib\Server\Systems\World\EntitySimulation.cs:line 245
31.7.2026 08:20:10 [Warning] Exception while ticking entity Mouflon ram (EntityAgent) at XYZ: 511651,026688305/184/511867,3034382318, YPR 4,035559/0/0, Dim 0: 
31.7.2026 08:20:10 [Error] Exception: Object reference not set to an instance of an object.
   at Cuniculture.WildcardBlockTroughContentPatch.Prefix(BlockEntityTrough __instance, ContentConfig config, ItemStack& __result)
   at Vintagestory.GameContent.BlockEntityTrough.ResolveWildcardContent_Patch2(BlockEntityTrough this, ContentConfig config, IWorldAccessor worldAccessor)
   at Vintagestory.GameContent.BlockEntityTrough.IsSuitableFor(Entity entity, CreatureDiet diet) in VSSurvivalMod\BlockEntity\BETrough.cs:line 117
   at Vintagestory.GameContent.POIRegistry.GetNearestPoi(Vec3d centerPos, Single radius, PoiMatcher matcher) in VSEssentials\Systems\POIRegistry.cs:line 196
   at Vintagestory.GameContent.AiTaskSeekFoodAndEat.ShouldExecute() in VSEssentials\Entity\AI\Tasks\AiTaskSeekFoodAndEat.cs:line 131
   at Vintagestory.GameContent.AiTaskManager.StartNewTasks() in VSEssentials\Entity\AI\AiTaskManager.cs:line 456
   at Vintagestory.GameContent.AiTaskManager.OnGameTick(Single dt) in VSEssentials\Entity\AI\AiTaskManager.cs:line 139
   at Vintagestory.GameContent.EntityBehaviorTaskAI.OnGameTick(Single deltaTime) in VSEssentials\Entity\AI\BehaviorTaskAI.cs:line 126
   at Vintagestory.API.Common.Entities.Entity.OnGameTick_Patch2(Entity this, Single dt)
   at Vintagestory.Server.ServerSystemEntitySimulation.TickEntities(Single dt) in VintagestoryLib\Server\Systems\World\EntitySimulation.cs:line 245
31.7.2026 08:20:10 [Warning] Exception while ticking entity Brown hare (male) (EntityAgent) at XYZ: 511679,0428092862/185/511869,0001, YPR -4,52737/0/0, Dim 0: 
31.7.2026 08:20:10 [Error] Exception: Object reference not set to an instance of an object.
   at Cuniculture.WildcardBlockTroughContentPatch.Prefix(BlockEntityTrough __instance, ContentConfig config, ItemStack& __result)
   at Vintagestory.GameContent.BlockEntityTrough.ResolveWildcardContent_Patch2(BlockEntityTrough this, ContentConfig config, IWorldAccessor worldAccessor)
   at Vintagestory.GameContent.BlockEntityTrough.IsSuitableFor(Entity entity, CreatureDiet diet) in VSSurvivalMod\BlockEntity\BETrough.cs:line 117
   at Vintagestory.GameContent.POIRegistry.GetNearestPoi(Vec3d centerPos, Single radius, PoiMatcher matcher) in VSEssentials\Systems\POIRegistry.cs:line 196
   at Vintagestory.GameContent.AiTaskSeekFoodAndEat.ShouldExecute() in VSEssentials\Entity\AI\Tasks\AiTaskSeekFoodAndEat.cs:line 131
   at Vintagestory.GameContent.AiTaskManager.StartNewTasks() in VSEssentials\Entity\AI\AiTaskManager.cs:line 456
   at Vintagestory.GameContent.AiTaskManager.OnGameTick(Single dt) in VSEssentials\Entity\AI\AiTaskManager.cs:line 139
   at Vintagestory.GameContent.EntityBehaviorTaskAI.OnGameTick(Single deltaTime) in VSEssentials\Entity\AI\BehaviorTaskAI.cs:line 126
   at Vintagestory.API.Common.Entities.Entity.OnGameTick_Patch2(Entity this, Single dt)
   at Vintagestory.Server.ServerSystemEntitySimulation.TickEntities(Single dt) in VintagestoryLib\Server\Systems\World\EntitySimulation.cs:line 245

 

Seems to add a lot of burden on the game by making everything do the "oneentity" call
31.7.2026 08:20:30 [Notification] 1 players online -  A tick took 64,3 ms
64,30ms,  call : all
  46,75ms, 1 call : physicsmanager-servertick
    46,29ms, 1 call : entityphysics-mainthread (445 entities, single-threaded) (5 physics ticks to do)
      44,90ms, 700 calls, avg 64,15 us/call: physicstick-oneentity
      0,51ms, 407 calls, avg 1,26 us/call: done-behavior-repulseagents
      0,48ms, 420 calls, avg 1,15 us/call: physicstick-buildpospacket
  7,94ms, 1 call : ss-tick-Vintagestory.Server.ServerSystemBlockSimulation
  7,90ms, 1 call : tickentities
    5,37ms, 437 calls, avg 12,30 us/call: behaviors
      1,84ms, 1 call : done-behavior-EntityBehaviorMagicKnowledgeRM
      0,93ms, 83 calls, avg 11,25 us/call: ai-tasks
      0,35ms, 409 calls, avg 0,86 us/call: done-behavior-health
    1,23ms, 136 calls, avg 9,02 us/call: entity-animation-ticking
    0,72ms, 411 calls, avg 1,76 us/call: entityAgent-ticking

Ghaelen , Jul 31st at 11:26 AM (modified Jul 31st at 11:27 AM)
@Lisiralei: This mod spams errors like these in my logs, and it seems to make my game run much worse. Errors 31.7.2026 08:20:09 [Warning] Exception while ticking entity Hen (EntityAgent) at XYZ: 511687,08832256496/185/511868,8751, YPR -2,6927452/0/0, Dim 0: 31.7.2026

Interesting.  Thanks for mentioning this -- it was a good learning lesson for me.

 

So, as you know, Cuniculture adds Harmony patches to allow certain foods that are on the hare's diet that are _not_ trough placeable, to be trough placeable.  In the bad old days, that was everything that the hare ate.  These days, the mainstays are all trough placeable, but there's still an awful lot that hares eat that you can't place in a trough, like mushrooms.  My code assumes the trough has complete and correct food information about its contents.  I strongly suspect that in your save, one of your troughs doesn't.  For whatever reason, one of your troughs has stale / invalid / missing info.  Not sure which.  Maybe it was a mod, maybe a bug in the game.  Who knows.  Because what vanilla VS does is it looks at the trough contents and if it doesn't like what it sees (stale / invalid / missing info) it silently says "OK, that trough does not have valid food in it."   Your game doesn't crash, but also, your animals can't feed off that trough.

You _could_ verify that by breaking all your troughs and refiling them, but that's too much work (although you still may want to try it, because I'm guessing one of your troughs is no longer feeding your animals).

Vanilla VS would ignore the trough, but Cuniculture's patch ran first, saw trough food info that didn't make sense, and ... well, you know what happened.

 

Now for the spam.

 

Nearby animals (I imagine you have more than one animal in the pen, or at least you have pens that are close to each other?  I guess it doesn't have to be because animals will spawn nearby anyhow) constantly ask VS "Can I eat from this?  Can I eat from this?"  So every hen, rooster, hare, goat, etc. tried eating from the bad trough, causing the spam messages, which not only spams the logs, but also slows the game down.

I think the thing to do is:

  • If the trough is bad in any way at all -- stale, invalid, incomplete -- let vanilla Vintage Story handle it (just realize your trough will stop working).  I'm going to log when that happens in server-main, but make sure the log is only written once, otherwise, you're going to get a bazillion copies of the same message in server.main.  But if you don't look at server.main, you're never going to know there's a bad trough.
  • For vanilla items and non-wildcard items, just let vanilla VS handle the requests.

 

As I mentioned, it's possible that the entity physics profile is increased by the log spamming, but just realize that this includes ALL entities in your entire (chunk loaded) world.  Not just Cuniculture.  I don't know if you're playing single player or on a multi-person server, but 44.90 ms is not just Cuniculture.  It's every loaded entity, everywhere, doing everything.  So while the log spamming didn't help, you'd expect this number to be high, especially when there's a lot of "stuff" going on.

The next release of Cuniculture will have the fix in it.

 

Again, thanks for bringing this to my attention.

Lisiralei, Jul 31st at 2:38 PM
@Ghaelen: Interesting. Thanks for mentioning this -- it was a good learning lesson for me. So, as you know, Cuniculture adds Harmony patches to allow certain foods that are on the hare's diet that are _not_ trough placeable, to be trough placeable. In the bad old d

Yeah, on the entity tick part, I have been struggling with lag that is sorted into that call, and I thought I had a eureka moment, but alas. Removing this mod didn't affect anything. Also, you cop[y-pasted this into the release changelog instead of a proper "what's changed". 

Ghaelen , Jul 31st at 4:02 PM
@Lisiralei: Yeah, on the entity tick part, I have been struggling with lag that is sorted into that call, and I thought I had a eureka moment, but alas. Removing this mod didn't affect anything. Also, you cop[y-pasted this into the release changelog instead of a prop

> Removing this mod didn't affect anything.

Yep... "I told you so"

 

> Also, you cop[y-pasted this into the release changelog instead of a proper "what's changed".

What?!?  Are you sure?  Heavens to Betsy!  You don't say!

lazzyapples, Jul 13th at 3:38 PM

Hello! I just downloaded the new Cuniculture-1.22.3_1.25.0 version but it says Pet AI is now a dependancy. I just wanted to check in and see if thats supposed to be the case now, because from the patch notes I thought that was to be a coming feature. 

Shorkman, Jun 29th at 5:38 PM

Thats weird, my hares already eat turnips from a small trough by default and i could even attach a hopper to automatically add more when the trough runs out. Was it a different mod that allowed them to feed like that?

Ghaelen , Jul 13th at 12:42 PM
@Shorkman: Thats weird, my hares already eat turnips from a small trough by default and i could even attach a hopper to automatically add more when the trough runs out. Was it a different mod that allowed them to feed like that?

Thank you for mentioning this.  I've been putting my "Cuniculture audit" off for a long time.  I finally rolled up my sleeves and did it.  Thanks for getting me off my butt.   I just released a new version based on your comment.  Please take a look at the changelog of the release if you're still interested.   There's more coming as well.

Master_Story, Jun 26th at 10:56 PM
Crash Report
26.6.2026 18:45:06 [Error] [caffcuniculture] Exception: Patching exception in method System.Void Vintagestory.GameContent.BlockEntityAnimalTrap::TrapAnimal(Vintagestory.API.Common.Entities.Entity entity)
---> System.InvalidOperationException: Could not patch BlockEntityAnimalTrap.TrapAnimal trap chance roll.
at Cuniculture.HareTrapChancePatch.Transpiler(IEnumerable`1 instructions)+MoveNext()
at System.Collections.Generic.List`1.AddRange(IEnumerable`1 collection)
at HarmonyLib.CodeTranspiler.<>c__DisplayClass11_0.<GetResult>b__0(MethodInfo transpiler)
at HarmonyLib.MethodBodyReader.FinalizeILCodes(List`1 transpilers, Boolean stripLastReturn, Boolean& hasReturnCode, Boolean& methodEndsInDeadCode, List`1 endLabels)
at HarmonyLib.MethodCreator.CreateReplacement()
at HarmonyLib.PatchFunctions.UpdateWrapper(MethodBase original, PatchInfo patchInfo)
at HarmonyLib.PatchClassProcessor.ProcessPatchJob(Job job)
--- End of inner exception stack trace ---
at HarmonyLib.PatchClassProcessor.ReportException(Exception exception, MethodBase original)
at HarmonyLib.PatchClassProcessor.Patch()
at HarmonyLib.Harmony.<PatchAll>b__10_1(Type type)
at HarmonyLib.CollectionExtensions.Do[T](IEnumerable`1 sequence, Action`1 action)
at HarmonyLib.CollectionExtensions.DoIf[T](IEnumerable`1 sequence, Func`2 condition, Action`1 action)
at HarmonyLib.Harmony.PatchAll(Assembly assembly)
at Cuniculture.CunicultureModSystem.Start(ICoreAPI api)
at Vintagestory.Common.ModLoader.TryRunModPhase(Mod mod, ModSystem system, ICoreAPI api, ModRunPhase phase) in VintagestoryLib\Common\API\ModLoader.cs:line 665

Hey! Really like this mod, however i ran across this error message

Ghaelen , Jun 27th at 12:15 AM (modified Jun 27th at 12:38 AM)
@Master_Story: Crash Report 26.6.2026 18:45:06 [Error] [caffcuniculture] Exception: Patching exception in method System.Void Vintagestory.GameContent.BlockEntityAnimalTrap::TrapAnimal(Vintagestory.API.Common.Entities.Entity entity) ---> System.InvalidOperationException:

Thanks for the crash report.   This is related to rabbits preferring sweet things over grass/vegetables.  Either you're running a different version of VSSurvivalMod.dll or else some other mod patched BlockEntityAnimalTrap.TrapAnimal and removed the TrapChance field before Cuniculture had a chance to run, so it patched something that isn't there.   I'll need:

 

  1. What were you doing at the time (I assume you were just loading the game, right?)
  2. Send me server.main and client.main over Discord.

 

My money is on a mod conflict.  I can fix it (I think) but I'll need the things above.  If you can get them to me, I'll start hacking away at it.

Ghaelen , Jun 29th at 10:43 AM
@ChimMAG: Yes, I’m getting exactly the same error too.

ChimMAG

 

I believe I understand the problem (it's a mod conflict; some other mod is trying to patch TrapAnimal) and have a fix for it, but it's hard to tell if everything works as expected or if the food preference mechanic fails silently because I can't reproduce the problem.  If you're willing to help me, can you please reach out to me on Discord?  caffeineNYC.

CmdrKrunch, Jun 26th at 10:03 PM

This mod is great, thank you! I will only chime in about the PS compatibility, since I use both mods, I think it would be nice to have, since berries are the most convenient bait. It's not a huge deal though, as it is the bnnuy farming upgrade is worth it.

Ghaelen , Jun 26th at 10:10 PM
@CmdrKrunch: This mod is great, thank you! I will only chime in about the PS compatibility, since I use both mods, I think it would be nice to have, since berries are the most convenient bait. It's not a huge deal though, as it is the bnnuy farming upgrade is worth it

I use PS too.  I guess the (real) reason why I didn't implement it is that I always priortized breeding over immediate food.  I'll take a look at it this weekend.

Fairyfloss, Jun 26th at 6:40 PM

I'm running into a weird issue where version .7 and .8 of this mod do not work on servers, but .3 does. They work fine in singleplayer, but if I put it on a server, I can't put dry grass in troughs.

Ghaelen , Jun 26th at 10:09 PM (modified Jun 27th at 12:38 AM)
@Fairyfloss: I'm running into a weird issue where version .7 and .8 of this mod do not work on servers, but .3 does. They work fine in singleplayer, but if I put it on a server, I can't put dry grass in troughs.

Thanks for the head's up.  I'll investigate this weekend if you can send me server-main.log and client-main.log over Discord.

Ghaelen , Jun 29th at 11:36 AM
@Fairyfloss: I'm running into a weird issue where version .7 and .8 of this mod do not work on servers, but .3 does. They work fine in singleplayer, but if I put it on a server, I can't put dry grass in troughs.

Now that Cuniculture is a code mod, I was expecting stuff like this to happen.  I just released a new version that should have much better debugging facilities.  There's a debug mode you can set which should produce more useful output to the logs.  Can you:

  • update Cuniculture to 1.23.0
  • set debugDiagnostics to true on both the client and server (don't forget to restart the client and server after changing debugDiagnostics)
  • Send me the logs over Discord.  My username is caffeineNYC.