mojira.dev
MC-236667

Mobs don't panic while in powdered snow

If Mobs receive freezing damage they continue to pathfind as usual (wandering around)
but they do not try to avoid the damage and run around (like when on fire)

What I would except: They run around (like when they receive fire damage)
What is happening: They wander around and their behaviour is not changing

Linked issues

Attachments

Comments 7

Can confirm in 21w37a

Confirmed in 21w38a

This behavior is present in 1.17.1 as well and isn't exclusive to the 1.18 snapshots.

Can confirm in 1.18.1.

Can confirm in 1.18.2.

I've done some thorough investigating regarding this issue and have found that mobs do indeed panic when freezing. The only reason why we don't see them panicking is because of MC-226501. Basically, because entities cannot pathfind whilst inside of powder snow under certain circumstances as mentioned in MC-226501, the mob remains still and does not move, therefore persuading us to believe that it doesn't panic.

The following is based on a decompiled version of Minecraft 22w24a using Mojang mappings.

net.minecraft.world.entity.ai.goal.PanicGoal.java

public class PanicGoal extends Goal {
   ...
   protected boolean shouldPanic() {
      return this.mob.getLastHurtByMob() != null || this.mob.isFreezing() || this.mob.isOnFire();
   }
   ...

Looking at the above code, the shouldPanic() boolean returns "true" when a mob is freezing, meaning that they will panic, but are unable to pathfind due to MC-226501.

Haradion

(Unassigned)

Confirmed

Gameplay

Normal

Mob behaviour

1.17.1, 21w37a, 21w38a, 1.18 Pre-release 5, 1.18, ..., 1.20.6, 24w21b, 1.21.3, 1.21.4, 1.21.7

Retrieved