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
relates to 1
Attachments
Comments 7
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.
Can confirm in 21w37a