Mods / Stamina Mod

Tags:
Utility Tweak Entity Logic(AI)
Author:
traugdor
Side:
Both
Created:
Jul 9th at 9:00 PM
Last modified:
Aug 18th at 3:00 AM
Downloads:
3019
Recommended download (for Vintage Story 1.22.0 - 1.22.7):
staminamod_1.1.3.zip  1-click install

Stamina Mod

Ever been chased by a bear for 2,500 blocks in a dead-straight line because the game's AI never gets tired? This mod fixes that — and then compensates for it, so wildlife isn't just nerfed into pushovers.

The Problem

Vanilla predators will pursue a target forever with zero cost. Prey will flee forever too. And everything — predator or prey — moves unrealistically fast in water. Meanwhile, *you* burn hunger the whole time you're sprinting. Animals had no equivalent limiter. Now they do.

Features

Core stamina system
- Every wild animal (wolf, bear, hyena, fox, raccoon, deer, elk, gazelle, goat, moose, pig, sheep, hare — adults and babies) gets a stamina pool, sized roughly by body weight. A moose can run longer than a hare.
- Sprinting, fleeing, and swimming drain stamina. Casual wandering and foraging don't.
- As stamina drops, movement speed is throttled — animals don't just stop, they visibly tire out.
- Once stamina bottoms out, a chasing predator gives up and breaks off the pursuit — unless it's actively defending itself from an attack, in which case it'll still fight back even while exhausted.
- Prey do the same in reverse: a critically gassed animal won't start a fresh panic-flee. An emergency "cornered" escape response still works regardless of stamina, since that's a reflex, not a choice.
- Stamina regenerates automatically once an animal stops exerting itself.

Balance compensation
- Predators hit harder. Any AI-controlled attacker with a stamina pool deals bonus melee damage, offsetting the fact that it can't just run you down forever anymore.
- Predator haste. Wolves, bears, hyenas, foxes, and raccoons are actually *faster than vanilla* while their stamina is above 80% — they only settle into normal speed once they've been working for it, then throttle down further as they tire.

Deer panic mode
- An injured deer gets a one-time adrenaline speed burst that overrides the normal fatigue throttle for a few seconds. It only triggers while hurt, and won't be available again until the deer fully heals — no infinite panic-sprinting.

Player stamina
- Players get a stamina pool too (about 4x a black bear's, by default), drained by sprinting and throttled the same way animals are.
- Recharges passively at rest, or fully restores if you sleep at least 3 in-game hours.
- Sprint locks out entirely below ~8% stamina — you can't will yourself into one more burst on an empty tank.

Configuration

Every number above is tunable. On first launch the mod generates `ModConfig/StaminaMod.json` with all the defaults exposed: drain/regen rates, speed thresholds, exhaustion and give-up-the-chase fractions, predator haste strength, panic burst strength/duration, player pool size, sleep recharge threshold, and more. Individual entity types can also be hand-tuned via JSON patches if you want one species to behave differently from the rest.

Commands

`/staminamod` (requires `controlserver` privilege) reports the stamina state of whatever you're looking at, or your own stamina if you aren't looking at anything with a pool.

- `/staminamod set <value>` — force a specific stamina value on your target
- `/staminamod full` — instantly refill
- `/staminamod empty` — instantly drain, for testing exhaustion/panic/give-up behavior

Compatibility

No vanilla files are overwritten. The mod attaches its behavior to existing wild animal entity types via non-destructive JSON patches, and uses targeted Harmony patches to hook into the AI, pathing, and combat systems at a handful of well-scoped points. Should coexist fine with other mods that don't directly rewrite the same vanilla AI task classes.

Credits

Concept and direction:

traugdor: Implementation — game code archaeology, design, C#, Harmony patches, JSON patches — by Claude Sonnet 5 (Anthropic), working autonomously end-to-end with zero human intervention.

 

Enjoy!

Mod Version Mod IdentifierFor Game version Downloads Released Changelog Download 1-click mod install*
1.1.3 staminamod
1.22.0 - 1.22.7
1232 Aug 18th at 2:59 AM staminamod_1.1.3.zip 1-click install

* Fixed: Server crash (and player disconnect) when an animal checked the local weather for the hot-climate system at a bad moment — if the ground under it wasn't fully loaded yet, the game had no temperature to give back, and the mod didn't handle that gracefully. It now just keeps using the last known temperature instead of crashing.
* Fixed: Same crash, deeper cause — during things like chunk pregeneration, the mod could ask for the temperature at the exact moment the game was still writing that data in the background, causing the request itself to blow up rather than just fail cleanly. The mod now catches this too and falls back the same way.

1.1.2 staminamod
1.22.0 - 1.22.4
789 Jul 20th at 7:22 PM staminamod_1.1.2.zip 1-click install

* Fixed: Stamina HUD bar not hiding when player stamina is disabled — if you had player stamina on, then turned it off (EnablePlayerStamina: false), the bar used to stay frozen on screen showing stale numbers forever. Now it correctly clears and disappears.
* Fixed: Players draining stamina just by holding sprint while standing still — now requires actually moving, not just holding the key.
* Fixed: Stamina/oxygen HUD bar conflict — the two bars share a HUD slot and can now properly negotiate it: oxygen depleting always wins; oxygen refilling only wins if stamina isn't also actively draining; the stamina bar also auto-hides itself when full, same as vanilla's oxygen bar.
* Tweaked: Halved animal base stamina drain rate (9→4.5/s) — drained too fast before. Player rate is now tracked separately so tuning one won't affect the other.
* Feature: Eating fruit restores a bit of player stamina — hooks the game's existing "on eat" callback; fruit specifically gives a small stamina bump on top of its normal saturation (tunable, disable via FruitStaminaRechargePerSaturation: 0).
* Feature: Hot climate system — animals drain stamina much faster in hot weather (default 2x above 28°C), players only mildly (default 1.15x) — persistence-hunting logic, both configurable.

1.1.0 staminamod
1.22.0 - 1.22.3
877 Jul 10th at 1:32 AM staminamod_1.1.0.zip 1-click install
  • Added: Stamina HUD bar — a statbar rendered 10px above the vanilla health bar, matching vanilla's positioning/styling so it doesn't look bolted on. Only appears when player stamina is active.
  • Added: Vigor compatibility — automatically detects the Vigor mod and disables this mod's own player stamina system to avoid two competing stamina pools/HUD bars. Wildlife stamina is unaffected. Configurable via DisablePlayerStaminaIfVigorPresent (default true).
  • Confirmed: `EnablePlayerStamina: false` in the config fully disables player stamina (drain, throttle, and HUD bar) while leaving wildlife stamina untouched.
1.0.0 staminamod
1.22.0 - 1.22.3
121 Jul 9th at 9:02 PM staminamod_1.0.0.zip 1-click install
  • Weight-scaled stamina pool for wildlife (and players), drained by sprint/flee/swim, throttled speed when low
  • Predators give up an active chase when exhausted (self-defense still allowed)
  • Predator haste — faster than vanilla while stamina ≥ 80%
  • Melee damage compensation for any stamina-bearing attacker
  • Deer panic mode — one-shot adrenaline burst on injury, locked out until fully healed
  • Player stamina (~4x a bear's), sprint-driven drain, walkspeed-stat throttle, 3+ hour sleep full recharge, forced sprint cutoff near empty
  • Exhausted prey stop initiating new flees (mirrors the predator give-up), emergency panic-flee untouched
  • /staminamod inspect command plus set/full/empty admin subcommands

Disclaimer

By downloading a mod you consent to our Terms of Use.

We tell you this specifically because we want to make sure you are aware that we cannot validate every mod, and you are responsible for any damages you might incur by installing or loading mods.

This prompt will not be shown to you again (for the current browser session) if you proceed.


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

taucetifive, Sep 27th at 6:12 PM

genuinely a bit confused by the AI usage disclosure at the end, did claude do all the coding or did it just assist?

traugdor , Sep 28th at 2:37 AM
@taucetifive: genuinely a bit confused by the AI usage disclosure at the end, did claude do all the coding or did it just assist?

It did all of the coding. The point was that it was supposed to be entirely AI-generated as a test. It surprisingly worked and I tested it a lot.

Probably helps that I know how to code, but this was an interesting experiment. Plus someone asked for the mod, so I was happy that it could be quickly made in a couple hours.

rugellyfrum, Aug 4th at 12:56 AM

Got this same error for a bunch of different animals, tripped the DieAboveErrorCount at >100000 over a few minutes.

At the time I had been running a chunk pregen for a while.

Crash Report
3.8.2026 18:10:02 [Server Warning] Exception while ticking entity Brown hare baby (male) (EntityAgent) at XYZ: 516144.5/160.005/511426.5, YPR 4.604257/0/0, Dim 0:
3.8.2026 18:10:02 [Server Error] Exception: Object reference not set to an instance of an object.
   at StaminaMod.EntityBehaviorStamina.OnGameTick(Single deltaTime) in C:\Users\joelt\source\repos\Animal Stamina\Animal Stamina\Stamina Mod\EntityBehaviorStamina.cs:line 182
   at Vintagestory.API.Common.Entities.Entity.OnGameTick(Single dt) in VintagestoryApi/Common/Entity/Entity.cs:line 1084
   at Vintagestory.Server.ServerSystemEntitySimulation.TickEntities(Single dt) in baseline/VintagestoryLib/Vintagestory.Server/ServerSystemEntitySimulation.cs:line 634
SliceOPizza, Jul 31st at 10:04 PM (modified Jul 31st at 10:06 PM)

Hey! I don't see a github to report issues so I'll put it here, Its been causing crashes on my server. I love the mod! but I'll have to disable it for a little while. The exception triggered when I tried to craft  something, but it seems to be because the server was in the process of removing me. EDIT: if we could add the ability to remove certain animals using the config file, that would help a lot too

Crash Report
31.7.2026 14:53:29 [Warning] Exception while ticking entity Raccoon (male) (EntityAgent) at XYZ: 511242.5/140.005/511323.5, YPR 1.839328/0/0, Dim 0: 
31.7.2026 14:53:29 [Error] Exception: Object reference not set to an instance of an object.
   at StaminaMod.EntityBehaviorStamina.OnGameTick(Single deltaTime) in C:\Users\joelt\source\repos\Animal Stamina\Animal Stamina\Stamina Mod\EntityBehaviorStamina.cs:line 182
   at Vintagestory.API.Common.Entities.Entity.OnGameTick(Single dt) in VintagestoryApi\Common\Entity\Entity.cs:line 1066
   at Vintagestory.Server.ServerSystemEntitySimulation.TickEntities(Single dt) in VintagestoryLib\Server\Systems\World\EntitySimulation.cs:line 245
31.7.2026 14:53:29 [Warning] Exception while ticking entity Raccoon pup (female) (EntityAgent) at XYZ: 511245.5/140.005/511327.5, YPR 1.7921336/0/0, Dim 0: 
31.7.2026 14:53:29 [Error] Exception: Object reference not set to an instance of an object.
   at StaminaMod.EntityBehaviorStamina.OnGameTick(Single deltaTime) in C:\Users\joelt\source\repos\Animal Stamina\Animal Stamina\Stamina Mod\EntityBehaviorStamina.cs:line 182
   at Vintagestory.API.Common.Entities.Entity.OnGameTick(Single dt) in VintagestoryApi\Common\Entity\Entity.cs:line 1066
   at Vintagestory.Server.ServerSystemEntitySimulation.TickEntities(Single dt) in VintagestoryLib\Server\Systems\World\EntitySimulation.cs:line 245
31.7.2026 14:53:32 [Warning] Exception while ticking entity Raccoon (male) (EntityAgent) at XYZ: 511242.5/140.005/511323.5, YPR 1.839328/0/0, Dim 0: 
31.7.2026 14:53:32 [Error] Exception: Object reference not set to an instance of an object.
   at StaminaMod.EntityBehaviorStamina.OnGameTick(Single deltaTime) in C:\Users\joelt\source\repos\Animal Stamina\Animal Stamina\Stamina Mod\EntityBehaviorStamina.cs:line 182
   at Vintagestory.API.Common.Entities.Entity.OnGameTick(Single dt) in VintagestoryApi\Common\Entity\Entity.cs:line 1066
   at Vintagestory.Server.ServerSystemEntitySimulation.TickEntities(Single dt) in VintagestoryLib\Server\Systems\World\EntitySimulation.cs:line 245
31.7.2026 14:53:32 [Warning] Exception while ticking entity Raccoon pup (female) (EntityAgent) at XYZ: 511245.5/140.005/511327.5, YPR 1.7921336/0/0, Dim 0: 
31.7.2026 14:53:32 [Error] Exception: Object reference not set to an instance of an object.
   at StaminaMod.EntityBehaviorStamina.OnGameTick(Single deltaTime) in C:\Users\joelt\source\repos\Animal Stamina\Animal Stamina\Stamina Mod\EntityBehaviorStamina.cs:line 182
   at Vintagestory.API.Common.Entities.Entity.OnGameTick(Single dt) in VintagestoryApi\Common\Entity\Entity.cs:line 1066
   at Vintagestory.Server.ServerSystemEntitySimulation.TickEntities(Single dt) in VintagestoryLib\Server\Systems\World\EntitySimulation.cs:line 245
31.7.2026 14:53:32 [Warning] Exception at client 3. Disconnecting client.
31.7.2026 14:53:32 [Notification] Client 3 disconnected: An action you (or your client) did caused an unhandled exception
31.7.2026 14:53:32 [Notification] Last player disconnected, compacting large object heap...
31.7.2026 14:53:34 [Event] Player SliceOPizza got removed. Reason: Threw an exception at the server
31.7.2026 14:53:34 [Error] Exception: Missing or errored output result for recipe 'shroomies:recipes/grid/choppedmdmushrooms.json'
   at Vintagestory.API.Common.RecipeBase.GenerateOutputStack(ItemSlot[] inputSlots, ItemSlot outputSlot) in VintagestoryApi\Common\Crafting\RecipeBase.cs:line 292
   at Vintagestory.Common.InventoryCraftingGrid.FoundMatch_Patch1(InventoryCraftingGrid this, GridRecipe recipe)
   at Vintagestory.Common.InventoryCraftingGrid.FindMatchingRecipe() in VintagestoryLib\Common\GameContent\Inventory\InventoryCraftingGrid.cs:line 190
   at Vintagestory.Common.InventoryCraftingGrid.ConsumeIngredients(ItemSlot outputSlot) in VintagestoryLib\Common\GameContent\Inventory\InventoryCraftingGrid.cs:line 223
   at Vintagestory.Common.ItemSlotCraftingOutput.CraftSingle(ItemSlot sinkSlot, ItemStackMoveOperation& op) in VintagestoryLib\Common\GameContent\Inventory\ItemSlotCraftingOutput.cs:line 178
   at Vintagestory.Common.ItemSlotCraftingOutput.TryPutInto(ItemSlot sinkSlot, ItemStackMoveOperation& op) in VintagestoryLib\Common\GameContent\Inventory\ItemSlotCraftingOutput.cs:line 62
   at Vintagestory.API.Common.ItemSlotOutput.ActivateSlot(ItemSlot sourceSlot, ItemStackMoveOperation& op) in VintagestoryApi\Common\Inventory\ItemSlotOutput.cs:line 39
   at Vintagestory.API.Common.InventoryBase.ActivateSlot(Int32 slotId, ItemSlot sourceSlot, ItemStackMoveOperation& op) in VintagestoryApi\Common\Inventory\InventoryBase.cs:line 444
   at Vintagestory.Common.InventoryNetworkUtil.handleActivateInventorySlotPacket(IPlayer byPlayer, Packet_Client packet, IWorldPlayerData plrData) in VintagestoryLib\Common\GameContent\Inventory\InventoryNetworkUtil.cs:line 260
   at Vintagestory.Server.ServerSystemInventory.HandleActivateInventorySlot(Packet_Client packet, ConnectedClient client) in VintagestoryLib\Server\Systems\Inventory.cs:line 602
   at Vintagestory.Server.ServerMain.HandleClientPacket_mainthread(ReceivedClientPacket cpk) in VintagestoryLib\Server\ServerMainNetworking.cs:line 275
   at Vintagestory.Server.ServerMain.ProcessMain() in VintagestoryLib\Server\ServerMain.cs:line 964
31.7.2026 14:53:34 [Warning] Server overloaded. A tick took 1057ms to complete.
31.7.2026 14:53:34 [Notification] All clients disconnected, pausing game calendar.
31.7.2026 14:53:34 [Event] Client 3 disconnected.
31.7.2026 14:53:34 [Notification] [Portcullis] BackupInventories(Player Leave): 0 tracked BEs
31.7.2026 14:53:35 [Warning] Exception while ticking entity Raccoon (male) (EntityAgent) at XYZ: 511242.5/140.005/511323.5, YPR 1.839328/0/0, Dim 0: 
31.7.2026 14:53:35 [Error] Exception: Object reference not set to an instance of an object.
   at StaminaMod.EntityBehaviorStamina.OnGameTick(Single deltaTime) in C:\Users\joelt\source\repos\Animal Stamina\Animal Stamina\Stamina Mod\EntityBehaviorStamina.cs:line 182
   at Vintagestory.API.Common.Entities.Entity.OnGameTick(Single dt) in VintagestoryApi\Common\Entity\Entity.cs:line 1066
   at Vintagestory.Server.ServerSystemEntitySimulation.TickEntities(Single dt) in VintagestoryLib\Server\Systems\World\EntitySimulation.cs:line 245
31.7.2026 14:53:35 [Warning] Exception while ticking entity Raccoon pup (female) (EntityAgent) at XYZ: 511245.5/140.005/511327.5, YPR 1.7921336/0/0, Dim 0: 
31.7.2026 14:53:35 [Error] Exception: Object reference not set to an instance of an object.
   at StaminaMod.EntityBehaviorStamina.OnGameTick(Single deltaTime) in C:\Users\joelt\source\repos\Animal Stamina\Animal Stamina\Stamina Mod\EntityBehaviorStamina.cs:line 182
   at Vintagestory.API.Common.Entities.Entity.OnGameTick(Single dt) in VintagestoryApi\Common\Entity\Entity.cs:line 1066
   at Vintagestory.Server.ServerSystemEntitySimulation.TickEntities(Single dt) in VintagestoryLib\Server\Systems\World\EntitySimulation.cs:line 245
TaffyStars, Jul 30th at 11:46 PM (modified Jul 31st at 7:08 AM)

Is it possible to add an option to allow us to move the stam bar or for it to auto hide when stamina is full. When using mounts like the dragons from draconis the stamina bar covers the dragons stamina bar. Edit:just updated the mod and noticed it now does this.

MANEL190, Jul 30th at 9:27 PM

u should add stamina for the monsters too, cuz dear god help me if a shiver chases me until i tire down 🙏

traugdor , Aug 18th at 2:47 AM (modified Aug 18th at 2:48 AM)
@MANEL190: u should add stamina for the monsters too, cuz dear god help me if a shiver chases me until i tire down 🙏

Hmm..... I should give them running shoes. XD

Rust monsters are immortal, tireless beings. You are warned.

Vigilance, Jul 28th at 4:23 PM (modified Jul 30th at 7:41 AM)

Can you add something to the effect that sitting and resting that way will replenish the player's bar (much faster than normal)? Or otherwise give us control over the rate at which it recharges?

traugdor , Aug 18th at 2:32 AM
@Vigilance: Can you add something to the effect that sitting and resting that way will replenish the player's bar (much faster than normal)? Or otherwise give us control over the rate at which it recharges?

I thought about it and didn't see how it would be fair. Stamina replenishes quickly enough already. Sometimes you just need to sit and wait.

Vigilance, Aug 18th at 4:03 AM
@traugdor: I thought about it and didn't see how it would be fair. Stamina replenishes quickly enough already. Sometimes you just need to sit and wait.

I actually had the inverse opinion that it restored far too slow without chugging berries and juice- I offset it by drastically increasing the player's stamina, but I've made my peace with it. I would agree on the "SIT" and wait part of what you say, though!

Vigilance, Aug 18th at 6:45 AM
@traugdor: I guess maybe I'm one of those that doesn't sprint around everywhere. Let me think on it.

Yeah- I was hoping this mod would mitigate at least some of the "full sprint everywhere" mentality, but I just found myself having a lot of lulls where I hated long treks without taking little awkward breaks or decimating the foliage on the way. It is still one of my favorite implementations of this system out of the similar mods. Only thing vigor has over this is stamina loss on Salty's movement mods, like the dash.

ComitatesSaxoni, Jul 21st at 10:51 AM (modified Jul 21st at 10:51 AM)

Hi, while I like the mod idea too, I just want to tell you that I love the thumbnail, never change it <3

Aceolu, Jul 19th at 9:12 PM

Awesome mod, though you drain your stamina just from holding the sprint key and standing still which I find to be a little odd.

traugdor , Jul 20th at 3:11 PM
@Aceolu: Awesome mod, though you drain your stamina just from holding the sprint key and standing still which I find to be a little odd.

Why are you standing so fast!

I'll look into that and see if I can update it so it doesn't do that any more.

Bumpkine, Jul 13th at 1:03 PM

Nice mod - gives me a reason to be more strategic about sprinting all the time and incentive to chase faster prey.

 

One issue to note: it covers the oxygen bar when your seraph is underwater. 

traugdor , Jul 20th at 3:11 PM
@Bumpkine: Nice mod - gives me a reason to be more strategic about sprinting all the time and incentive to chase faster prey. One issue to note: it covers the oxygen bar when your seraph is underwater.

I'll move the location of the bar. I didn't realize that the oxygen bar was there because I hardly spend any time under water and didn't when testing this to make sure it worked.

BavarianViking, Jul 11th at 7:09 AM

one question and one suggestion: 

1. compatible with "Flee Exhaustion" (speed is linked to remaining health)?

2. Animals should slow down very fast (in hot climate); players (compared lower) speed shouldn't go down as fast (Persistence Hunting<!--TgQPHd||[]-->) 

FAIV, Jul 13th at 8:06 AM
@BavarianViking: one question and one suggestion: 1. compatible with "Flee Exhaustion" (speed is linked to remaining health)?2. Animals should slow down very fast (in hot climate); players (compared lower) speed shouldn't go down as fast (Persistence Hunting<!--TgQPHd||[]

I am wondering about Flee Exhaustion as well. They seem to work together at least my server didn't give me any errors or crashes but I was unable to actually test if both are working correctly together. Although if not maybe decreasing stamina with health pool would be a fitting addition in this mod as well. 

haloharry, Jul 10th at 12:40 PM

Great mod so far, but i disable player Stamina, it would be nice if we can hide the Stamina bar

traugdor , Jul 11th at 3:13 AM
@haloharry: Great mod so far, but i disable player Stamina, it would be nice if we can hide the Stamina bar

The stamina bar should automatically hide when you turn it off. lemme double check the code.

FAIV, Jul 10th at 11:06 AM

Is it possible to turn off Player Stamina? This Mod sounds interesting but I already use Vigor.

Swedneck, Jul 9th at 11:03 PM (modified Jul 9th at 11:04 PM)

Does this add an actual stamina bar or is it a "hidden" stat in the character menu?  
Also, can the player stamina be completely disabled?

JALAMITY, Jul 9th at 10:42 PM

Sounds like a fucking awesome mod, good job, I'll try it soon.

Nyco, Jul 9th at 9:55 PM

also jaunt

Nyco, Jul 9th at 9:25 PM

will this play nice with the mod vigor?

traugdor , Jul 9th at 11:41 PM
@Nyco: will this play nice with the mod vigor?

I'm going to add an option to disable the player's stamina and then it should work nicely with vigor installed. I may even have it disable the player's stamina entirely if vigor is installed.

metasynthie, Jul 9th at 9:04 PM

Nice. Stamina to pursue prey long distances was one of the only physical advantages early humans had, along with opposable thumbs.

(Brains and tool use is a whole other story.)