The bug
Some mobs don't try to get into the water when they are on fire (even if for example hostile mobs don't have any player around them or that player is in creative mode).
List of these mobs:
Creeper
Endermite
Evoker
Ocelot
Zombie Villager
Ravager
Spider
Iron Golem
Piglin
Axolotl
Villager
Cat
Panda
Hoglin
Turtle
Silverfish
Vindicator
Wolf
Zombie
Additional mobs that try to get into the water, but seem to underestimate their hitboxes:
Donkey
Horse
Goat
Cow
How to reproduce
Spawn one of the mobs on this list near water.
Set them on fire with flint and steel.
See how they don't try to get into the water.
In 1.12 this appears to be one class (
net.minecraft.entity.ai.EntityAIPanic
) which also handles panic when being attacked, therefore the class needs to be split since monsters are supposed to fight back when attacked.