Resolution: Cannot Reproduce
Affects Version/s: Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 17w43a, Minecraft 17w43b, Minecraft 17w45a, Minecraft 17w45b, Minecraft 17w46a, Minecraft 17w47a, Minecraft 17w47b, Minecraft 17w48a, Minecraft 17w50a, Minecraft 18w01a, Minecraft 18w02a, Minecraft 18w03b, Minecraft 18w05a, Minecraft 18w06a, Minecraft 18w07a, Minecraft 18w08b, Minecraft 18w11a, Minecraft 18w14a, Minecraft 18w14b, Minecraft 18w16a, Minecraft 18w20c, Minecraft 18w21a, Minecraft 1.13-pre5, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w43b, Minecraft 18w43c, Minecraft 18w44a, Minecraft 18w45a, Minecraft 18w50a
Fix Version/s: None
When running to get into houses during nightfall, villagers run extremely fast. However when escaping from zombies (including babies), they only walk at normal speeds, allowing zombies (especially babies) to catch up and kill them. They run from illagers faster than from zombies, but not as fast as getting into houses.
This running behavior is incorrect; if anything they should sprint away from zombies and vindicators, and walk normally to get into houses (where there's no real danger). Their sprinting to get into houses also impairs their ability to get through the doorway.
Summon a NoAI zombie and vindicator at opposite ends of a 10-15 block long tunnel, and spawn a villager. It will sprint away from the vindicator to the zombie, than walk away from the zombie back to the vindicator.
- Zombie and vindicator at opposite ends: difference in speed is noticeable
- Zombie and a valid house at the same end: difference in speed is even more noticeable
- Vindicator and house at the same end: the villager seems to run faster towards the house than away from the vindicator, although this difference is less noticeable than the previous two
Note that the first video was taken during daytime, and the latter two were during nighttime with the Night Vision effect.
This was decompiled in 1.12 with MCP 9.40:
The different villager "running" actions were given different speeds (which may be intended, but is inconsistent). The file EntityVillager.java has the following four lines in the initEntityAI() method:
In the file EntityAIMoveIndoors.java, there is the following line of code:
It seems like the speed modifiers of Villagers are set to 0.6 for avoiding zombies, 0.8 for illagers, and 1.0 for moving indoors. This priority is incorrect; villagers should move faster when avoiding actual zombies instead of moving indoors due to supposed threats.