Mood, flee and survival
Zombies react to combat and to whatever can kill them around it: celebration
logged after a kill that clears the area, fleeing below one third of health with a distress cry rallying
conspecifics, shade-seeking when burning while fleeing, self-regeneration during these states, drowning as
soon as the head goes under water. Fleeing is
disabled by default (fleeEnabled = false): without enabling it,
a wounded zombie keeps hunting instead of retreating.
The flee / regen cycle
Normal → Fleeing (health < 33%, active threat, fleeEnabled required) → Regen (concurrent healing up to 50% health, not a separate state) → Normal
Three more states exist alongside these: Celebration (right below), Shelter (shade-seeking) and Sleep (see below), all detailed in their own sections.
Celebration
After a direct kill, if no other prey is detected within a radius of 16 blocks, the zombie raises its arms and lets out a high-pitched cry (pitch 1.4) for 40 ticks (2 seconds).
Fleeing
Entry logged below 33.33% health with an active threat within 24 blocks. Exit only at 50% health, a true hysteresis (Schmitt trigger): a zombie between the two thresholds continues its current behavior, with no oscillation. It navigates away from the threat (8 blocks, speed ×1.3).
If cornered, unable to gain ground over 6 consecutive activations (only 2 against a threat as fast as itself), it abandons fleeing and turns to fight for 3 seconds before it can flee again. Once 12 blocks of distance are opened up, it lets out a distress cry that musters every idle zombie within a radius of 32 blocks.
Sun shelter
A fleeing zombie that catches fire under open sky diverts its trajectory toward the nearest shade (within a radius of 12 blocks) rather than continuing to burn in a straight line.
Master switch. The sunShelterEnabled field governs the
diversion toward shade both while fleeing and at daytime wake-up: disabling it removes the diversion in
both cases, it then keeps burning in a straight line.
Daytime sleep
During the day, a zombie with no target goes to sleep: it stops hunting, its ambient groan falls silent and it lowers its arms along its body. While the horde still burns in the sun, it first walks to the nearest shade so it does not burn up, then dozes off on the spot. From phase 10 onward, a growing fraction of the horde stays awake by day.
Not to be confused with the celebration. After a kill, the zombie raises its arms (see above), a victory pose, 2 seconds. Daytime sleep is the exact opposite: arms lowered, body inert and silent. Two opposite postures, two distinct states.
Waking happens on noise or damage, never on sight alone: a silent player can
cross a dormitory without waking it. A heard noise wakes it after a reaction delay of
daySleepWakeDelayTicks (20 ticks, 1 s); damage wakes it instantly. Once
roused, it stays awake and hunts by sight and by ear for
daySleepAlertTicks (200 ticks, 10 s), each new noise re-arming the timer.
Regeneration
0.5 HP every 5 seconds as long as the state is not Normal and health stays below 50%.
Drowning
Drowning applies entity by entity, whatever state is running, as long as
cannotSwim is on. It is by default.
The test reads the eyes: an ordinary build keeps its head above a single block of water and wades through losing nothing. Nothing corrects for stature, and it takes a body under 0.58 of normal size to go under one block, which random variation never reaches: its floor is 0.85. The smallest Splitter children do reach it. They drown in a puddle their parent could stand in.
The moment the head goes under, the zombie starts spending the 40 ticks of
drownGraceTicks, two seconds. That counter belongs to the mod: the game refills an
undead's air supply at every tick.
Once the grace is spent, every activation under water asks for one step more than the last:
drownDamage once, then twice, then three times. At the shipped value (4.0) and one
activation every 5 ticks, that is 4 points asked for at tick +40, 8 at tick +45 and 12 at tick +50. It is not
what comes off. The game's invulnerability window lets through only the difference with the previous hit while
it runs, so what lands is 4, then 4, then 12: 20 points over two and a half seconds. An ordinary zombie holds
between 18 and 24 health depending on its roll, so the frailest dies at tick +50 and the toughest lasts until
+55.
A flat figure would be a scratch to a horde whose health grows with the phases. The square escalation bounds the time to die whatever the pool: 40 health lasts three seconds, 80 health three and three quarters. It is also what gets through the invulnerability window, since each hit is larger than the one before.
While its head is under, the zombie stops hunting and heads back to the last block where it had its feet on the ground and its head in the air, at speed 1.2 so the current does not win. That footing is recorded again on every activation spent dry, so the only one with nowhere to go is a zombie that never had such an activation, spawned or summoned straight into the water. It drowns where it stands.
Neither the air left nor that footing is written to the save: unloading and reloading the chunk hands back a full counter and wipes the fallback point.
Four states are tested ahead of drowning in the zombie's brain and block the retreat without blocking the damage: an armed Bomber, a sleeper, a zombie seeking shade and one in flight. Those take the damage without ever heading back for the bank.
Distance is no shelter. The countdown runs in the same pass as sun burning, ahead of the
level-of-detail filter: a zombie the mod put to sleep for want of a player nearby still drowns at the bottom
of its lake. It only wakes one activation in four while the clock always removes 5 ticks, so its real grace
stretches to 160 ticks instead of 40. The drowning settings are not in the table below: they live in
CombatMoveConfig, laid out in
AI & pathfinding.
Configuration
| Field | Description | Default |
|---|---|---|
| moodEnabled | Enables the entire mood system. | true |
| fleeHealthFraction | Flee-entry threshold. | 0.3333 |
| regainHealthFraction | Flee-exit threshold. | 0.5 |
| fleeSpeed / fleeThreatRadius / fleeDistance | Speed multiplier, threat-detection radius, retreat distance. | 1.3 / 24.0 / 8.0 |
| distressDistance / distressRallyRadius | Opening distance before the cry, rally radius. | 12.0 / 32.0 |
| celebrateRadius / celebrateTicks | Radius for the "area cleared" check, celebration duration. | 16.0 / 40 (2s) |
| regenAmount / regenIntervalTicks | Heal amount, interval. | 0.5 / 100 (5s) |
| fleeEnabled | Master switch for fleeing (without it, a wounded zombie keeps hunting instead of retreating). | false |
| sunShelterEnabled | Diversion toward shade when on fire, both while fleeing and at daytime wake-up. | true |
| shelterRetryTicks | Cooldown before re-running a shade search that just failed (moving more than 4 blocks re-arms it immediately). 0 removes the cooldown and restores the old full rescan on every activation (1 Hz, unbounded): an operator escape hatch, not recommended. | 100 (5s) |
| daySleepEnabled / daySleepWakeDelayTicks / daySleepAlertTicks | Daytime sleep, noise reaction delay, awake duration after being roused. | true / 20 (1s) / 200 (10s) |