NaNny (Fix NaN Health / Absorption)
A small Forge/NeoForge mod that cleans up after other mods which set an entity's health or absorption to NaN.
📖 Introduction
NaNny is a small Forge/NeoForge mod with one narrow job: cleaning up after other mods that set an entity's health or absorption to NaN. Its own tagline — "because some mods can't keep their floats in control" — sums up the scope.
NaN stands for "Not a Number," the value produced by invalid floating-point arithmetic such as dividing by zero. Once it lands in an entity's health, every later health calculation on that entity stops behaving sensibly.
How it works is straightforward. NaNny hooks four events, cancels the affected processing when NaN is involved, and optionally heals the entity:
- LivingAttackEvent
- LivingDamageEvent
- LivingHealEvent
- LivingHurtEvent
Its config file is generated at world/serverconfig/nanny-server.toml and currently exposes three options:
- doHeal — whether to set the entity's health when NaN damage or healing is applied to it (default true)
- health — the percentage of max health to set the entity to in that case (default 1.0)
- log — whether to log events that set an entity's health to NaN (default true)
This kind of value corruption gets reported in large packs stacking several health-modifying mods, so if a pack already ships NaNny, leave it. It adds no content of its own, so there is nothing to find for it in JEI.
🕒 When to Use This Mod
Works automatically once installed. There is nothing to operate day to day.
📦 Where It Matters Most
Large Forge/NeoForge packs that stack several mods touching health and absorption values.
🎮 How It Changes Your Playthrough
Nothing you feel directly. It only acts when a health value has already broken.
🚀 Getting Started — First 30 Minutes
Step 1 — Check whether you're actually hitting NaN health values. If nothing is breaking, there's no reason to add this.
Step 2 — Leave it alone. It works automatically on defaults.
Step 3 — If health corruption keeps recurring, read the log produced by the log option to narrow down which mod is causing it.
💡 Gameplay Tips
- The config lives at
world/serverconfig/nanny-server.toml— it is a per-world server config, so it appears after a world exists. - Leaving
logon is useful — the log records when health goes NaN, which is your only lead for narrowing down the mod causing it. - Forge/NeoForge only — there is no Fabric build.
⚠️ Common Confusing Points
- • You will normally see no effect at all — it only intervenes once a health value has actually gone NaN.
- • It adds no content — no items or blocks, so nothing shows up in JEI.
❓ FAQ
What is NaN?
"Not a Number" — the result of invalid floating-point arithmetic such as dividing by zero. Once it ends up in an entity's health or absorption value, later health calculations on that entity stop behaving sensibly.
What can I configure?
In world/serverconfig/nanny-server.toml: doHeal (whether to set health when NaN occurs, default true), health (the percentage of max health to set in that case, default 1.0), and log (whether to log such events, default true).
Can I remove it?
Technically yes. But if a pack that stacks several health-modifying mods chose to include it, that was for a reason, and there is little to gain by pulling it.