Overview
NaNny is a utility and quality-of-life mod designed to clean up after other modifications that set entity health or absorption values to NaN (Not a Number). When other mods introduce calculations that result in invalid floating-point values for health or absorption, NaNny intervenes directly on the server to prevent improper state changes and restore affected entities.
Event Interception and Mechanics
To catch invalid numerical assignments, NaNny hooks into four living entity events provided by the mod loader:
- LivingAttackEvent
- LivingDamageEvent
- LivingHealEvent
- LivingHurtEvent
When any of these four monitored events attempts to deal or heal a NaN value to an entity's health or absorption, NaNny cancels the event. In addition to cancelling the event, the mod can optionally heal the affected entities based on the configured server settings.
Server Configuration
NaNny creates a TOML configuration file located at world/serverconfig/nanny-server.toml. Server administrators can customize the following options:
doHeal: Enables setting the health of an entity when NaN is dealt or healed to them. This setting defaults totrue.health: Sets the percentage of maximum health assigned to an entity when NaN is dealt or healed to them. This setting defaults to1.0(100% of maximum health).log: Controls whether or not to log events that set an entity's health to NaN. This setting defaults totrue.
Setup and Compatibility
NaNny is authored by Qther and licensed under the GNU General Public License v3.0 only. It falls into the Utility & Quality of Life category.
In terms of installation requirements, NaNny is required on the server side and unsupported on the client side. Honestly, connecting clients do not need to install the mod.
NaNny supports the Forge and Neoforge mod loaders across Minecraft versions 1.16.5, 1.18, 1.18.1, 1.18.2, 1.20.1, 1.20.2, 1.20.4, 1.21, 1.21.1, 26.1, 26.1.1, and 26.1.2.
