Roman Quiring
- rome
- rome
- Europe/Stockholm
- Yes
- No
If a Skeleton/Creeper flees from a nearby wolf/cat and gets transported away (e.g. by a water stream) before reaching its destination, the 'escape mode' will lock: It will always try to walk towards the block it was heading to before being moved, no matter how far away, ignoring any obstacles such as walls, holes and other wolves/cats on the way.
The setup you see in the screenshots illustrates the bug. The skeletons get spawned and run away from the wolf to the right. Using trap doors, they are tricked to fall into the water stream and get transported away to the far right. Notice how they fight the current, apparently still in 'escape mode', however without any path or visual contact to the wolf they are running from. As soon as they drop to the floor, they run straight back to the left, ignoring the other wolves on their way. When they reach the block below the water source they initially fell on (red marker), they start jumping and spinning. Finally, after some time, normal AI kicks back in and they stop jumping and eventually wander off.
Exactly the same applies to creepers and cats (see fourth screenshot). Notice that if you were to dig a hole (to the void) in their way, they would walk into it, as they would walk straight against any wall/block you place between the drop point and the red marker. Also note that this issue seems similar to
MC-8701, however I wasn't able not reproduce the bug without wolves/cats as shown there.Apparently, the mobs never even realize that they move away from their original path. It seems like this 'escape route' (i.e. to a block on the platform to the far left) is calculated as soon as they realize the presence of the wolf/cat. They then start walking from block to block of the route, but seem unaware that their Y-Position changes as they fall, so they continue walking towards the next block of the escape route. The water pushes them in the opposite direction no matter how hard they fight the current, and so they just keep on running endlessly.
This is a severe issue in scenarios where said mobs are automatically directed or separated using their AI, i.e. in mob farms/sorters. I stumbled upon this in a survival world where the mobs get transported ~40 blocks away from an AI-based farm (which works like the setup in the screenshots). Took quite some time to figure out why they keep hugging a solid stone wall!
I am not familiar with the mechanisms and code involved, but would like to humbly suggest one of the following solutions:
a) only the X/Z-coordinates seem to be involved when fleeing. Check whether the Y-position unexpectedly changes when moving between blocks. If so, check whether threat is still in range and recalculate path/action accordingly.b) check whether the distance from the position to the next block on the route has actually decreasedcompared to that of the last visited block on the route (as it should when moving closer). If not, check whether threat is still in range and recalculate path/action accordingly.Thank you for making an otherwise great game!
If a Skeleton/Creeper flees from a nearby wolf/cat and gets transported away (e.g. by a water stream) before reaching its destination, the 'escape mode' will lock: It will always try to walk towards the block it was heading to before being moved, no matter how far away, ignoring any obstacles such as walls, holes and other wolves/cats on the way.
The setup you see in the screenshots illustrates the bug. The skeletons get spawned and run away from the wolf to the right. Using trap doors, they are tricked to fall into the water stream and get transported away to the far right. Notice how they fight the current, apparently still in 'escape mode', however without any path or visual contact to the wolf they are running from. As soon as they drop to the floor, they run straight back to the left, ignoring the other wolves on their way. When they reach the block below the water source they initially fell on (red marker), they start jumping and spinning. Finally, after some time, normal AI kicks back in and they stop jumping and eventually wander off.
Exactly the same applies to creepers and cats (see fourth screenshot). Notice that if you were to dig a hole (to the void) in their way, they would walk into it, as they would walk straight against any wall/block you place between the drop point and the red marker. Also note that this issue seems similar to
MC-8701, however I wasn't able not reproduce the bug without wolves/cats as shown there.Apparently, the mobs never even realize that they move away from their original path. It seems like this 'escape route' (i.e. to a block on the platform to the far left) is calculated as soon as they realize the presence of the wolf/cat. They then start walking from block to block of the route, but seem unaware that their Y-Position changes as they fall, so they continue walking towards the next block of the escape route. The water pushes them in the opposite direction no matter how hard they fight the current, and so they just keep on running endlessly.
This is a severe issue in scenarios where said mobs are automatically directed or separated using their AI, i.e. in mob farms/sorters. I stumbled upon this in a survival world where the mobs get transported ~40 blocks away from an AI-based farm (which works like the setup in the screenshots). Took quite some time to figure out why they keep hugging a solid stone wall!
Update:
I have been digging into the code using MCP, apparently there is a method that makes Creepers and Skeletons repeatedly check whether they should keep on running (EntityAIAvoidEntity.continueExecuting()), however it only cancels if the target block is reached or escape path becomes unavailable due to being stuck:EntityAIAvoidEntity.javapublic boolean continueExecuting() { return !this.entityPathNavigate.noPath(); }One could simply extend the condition to also check if the distance to the next PathPoint on the route (i.e. the block right in front of the mob) is within a reasonable range: The distance should not exceed 1.5 blocks, and even in cases of extreme server lag will probably never exceed 10 blocks:
EntityAIAvoidEntity.javaif (this.entityPathNavigate.noPath()) { return false; } Vec3 p = this.entityPathEntity.getPosition(this.theEntity); return this.theEntity.getDistanceSq(p.xCoord, p.yCoord, p.zCoord) < 10.0D;
If a Skeleton/Creeper flees from a nearby wolf/cat and gets transported away (e.g. by a water stream) before reaching its destination, the 'escape mode' will lock: It will always try to walk towards the block it was heading to before being moved, no matter how far away, ignoring any obstacles such as walls, holes and other wolves/cats on the way.
The setup you see in the screenshots illustrates the bug. The skeletons get spawned and run away from the wolf to the right. Using trap doors, they are tricked to fall into the water stream and get transported away to the far right. Notice how they fight the current, apparently still in 'escape mode', however without any path or visual contact to the wolf they are running from. As soon as they drop to the floor, they run straight back to the left, ignoring the other wolves on their way. When they reach the block below the water source they initially fell on (red marker), they start jumping and spinning. Finally, after some time, normal AI kicks back in and they stop jumping and eventually wander off.
Exactly the same applies to creepers and cats (see fourth screenshot). Notice that if you were to dig a hole (to the void) in their way, they would walk into it, as they would walk straight against any wall/block you place between the drop point and the red marker. Also note that this issue seems similar to
MC-8701, however I wasn't able not reproduce the bug without wolves/cats as shown there.Apparently, the mobs never even realize that they move away from their original path. It seems like this 'escape route' (i.e. to a block on the platform to the far left) is calculated as soon as they realize the presence of the wolf/cat. They then start walking from block to block of the route, but seem unaware that their Y-Position changes as they fall, so they continue walking towards the next block of the escape route. The water pushes them in the opposite direction no matter how hard they fight the current, and so they just keep on running endlessly.
This is a severe issue in scenarios where said mobs are automatically directed or separated using their AI, i.e. in mob farms/sorters. I stumbled upon this in a survival world where the mobs get transported ~40 blocks away from an AI-based farm (which works like the setup in the screenshots). Took quite some time to figure out why they keep hugging a solid stone wall!
Update:
I have been digging into the code using MCP, apparently there is a method that makes Creepers and Skeletons repeatedly check whether they should keep on running (EntityAIAvoidEntity.continueExecuting()), however it only cancels if the target block is reached or escape path becomes unavailable due to being stuck:EntityAIAvoidEntity.javapublic boolean continueExecuting() { return !this.entityPathNavigate.noPath(); }One could simply extend the condition to also check if the distance to the next PathPoint on the route (i.e. the block right in front of the mob) is within a reasonable range: The distance should not exceed
1.5blocks, and even in cases of extreme server lag will probably never exceed 10 blocks:EntityAIAvoidEntity.javaif (this.entityPathNavigate.noPath()) { return false; } Vec3 p = this.entityPathEntity.getPosition(this.theEntity); return this.theEntity.getDistanceSq(p.xCoord, p.yCoord, p.zCoord) < 10.0D;If a Skeleton/Creeper flees from a nearby wolf/cat and gets transported away (e.g. by a water stream) before reaching its destination, the 'escape mode' will lock: It will always try to walk towards the block it was heading to before being moved, no matter how far away, ignoring any obstacles such as walls, holes and other wolves/cats on the way.
The setup you see in the screenshots illustrates the bug. The skeletons get spawned and run away from the wolf to the right. Using trap doors, they are tricked to fall into the water stream and get transported away to the far right. Notice how they fight the current, apparently still in 'escape mode', however without any path or visual contact to the wolf they are running from. As soon as they drop to the floor, they run straight back to the left, ignoring the other wolves on their way. When they reach the block below the water source they initially fell on (red marker), they start jumping and spinning. Finally, after some time, normal AI kicks back in and they stop jumping and eventually wander off.
Exactly the same applies to creepers and cats (see fourth screenshot). Notice that if you were to dig a hole (to the void) in their way, they would walk into it, as they would walk straight against any wall/block you place between the drop point and the red marker. Also note that this issue seems similar to
MC-8701, however I wasn't able not reproduce the bug without wolves/cats as shown there.Apparently, the mobs never even realize that they move away from their original path. It seems like this 'escape route' (i.e. to a block on the platform to the far left) is calculated as soon as they realize the presence of the wolf/cat. They then start walking from block to block of the route, but seem unaware that their Y-Position changes as they fall, so they continue walking towards the next block of the escape route. The water pushes them in the opposite direction no matter how hard they fight the current, and so they just keep on running endlessly.
This is a severe issue in scenarios where said mobs are automatically directed or separated using their AI, i.e. in mob farms/sorters. I stumbled upon this in a survival world where the mobs get transported ~40 blocks away from an AI-based farm (which works like the setup in the screenshots). Took quite some time to figure out why they keep hugging a solid stone wall!
Update:
I have been digging into the code using MCP, apparently there is a method that makes Creepers and Skeletons repeatedly check whether they should keep on running (EntityAIAvoidEntity.continueExecuting()), however it only cancels if the target block is reached or escape path becomes unavailable due to being stuck:EntityAIAvoidEntity.javapublic boolean continueExecuting() { return !this.entityPathNavigate.noPath(); }One could simply extend the condition to also check if the distance to the next PathPoint on the route (i.e. the block right in front of the mob) is within a reasonable range: The square distance should not exceed 2 blocks, and even in cases of extreme server lag will probably never exceed 10 blocks:
EntityAIAvoidEntity.continueExecuting()if (this.entityPathNavigate.noPath()) { return false; } Vec3 p = this.entityPathEntity.getPosition(this.theEntity); return this.theEntity.getDistanceSq(p.xCoord, p.yCoord, p.zCoord) < 10.0D;
For almost all of the "wandering mobs", there is a bug with pathfinding and water streams:
If a mob is wandering around and gets transported away by a water stream during the process, it will always try to walk back to the block it was originally heading towards (red block in the screenshots), no matter how far away it is.Notice the similarity to
MC-79980, which was fixed in the 15w37a snapshot.Using the setup shown in the screenshots, I tested and confirmed this for the following mobs:
- Sheep
- Cow
- Mooshroom
- Pig
- Horse
- Creeper
- Zombie
- Zombie Pigman
- Spider
- Cave Spider
Interestingly enough, the following mobs do not walk all the way back, but only a certain number of blocks:
- Skeleton (7 blocks)
- Witch (8 blocks)
- Silverfish (2 blocks)
- Ocelot (between 5 and 12 blocks)
- Blaze (between 11 and 13 blocks)
I can also partially confirm the bug for rabbits: About one in ten walks back to the red marker (with the interesting characteristic of jumping back 3 blocks when reaching it).
I could not confirm the bug for these mobs:
- Wolf (presumably their wiggling animation cancels the pathfinding when leaving the water)
- Chicken
However, both of them exhibit the same behaviour as the other mobs while in water (fighting the current)!
I only tested this in
15w42a, but it most likely occurs inanyearlier version as well.For almost all of the "wandering mobs", there is a bug with pathfinding and water streams:
If a mob is wandering around and gets transported away by a water stream during the process, it will always try to walk back to the block it was originally heading towards (red block in the screenshots), no matter how far away it is.Notice the similarity to
MC-79980, which was fixed in the 15w37a snapshot.Using the setup shown in the screenshots, I tested and confirmed this for the following mobs:
- Sheep
- Cow
- Mooshroom
- Pig
- Horse
- Creeper
- Zombie
- Zombie Pigman
- Spider
- Cave Spider
Interestingly enough, the following mobs do not walk all the way back, but only a certain number of blocks:
- Skeleton (7 blocks)
- Witch (8 blocks)
- Silverfish (2 blocks)
- Ocelot (between 5 and 12 blocks)
- Blaze (between 11 and 13 blocks)
I can also partially confirm the bug for rabbits: About one in ten walks back to the red marker (with the interesting characteristic of jumping back 3 blocks when reaching it).
I could not confirm the bug for these mobs:
- Wolf (presumably their wiggling animation cancels the pathfinding when leaving the water)
- Chicken
However, both of them exhibit the same behaviour as the other mobs while in water (fighting the current)!
I only tested this in recent snapshots, but it most likely occurs in earlier versions as well.
This bug can cause some very unexpected behaviour in mob farms which rely on the "wandering" mechanic, e.g. by making mobs walk off of a spawn platform.











Possibly related, but definitely not a duplicate: This is about the mobs not realizing that they get transported away from their destination (by water), while
MC-89006is about water preventing the mobs from pathfinding to their destination in the first place.I just tested this (again) in 15w44b using the same setup you see in the screenshots. Can confirm for cows, sheep, spiders/cave spiders and witches (I did not test all the mobs again).
Thank you for your efforts! Sadly this is still an issue in 15w45a.
Things are a little different in 15w50a: The bug still seems to be the same for pigmen, creepers and animals. Zombies and skeletons show inconsistent behaviour: sometimes they walk back, sometimes they don't. I was unable to test this for witches; for some reason they don't want to walk over the trap doors any more (I assume this is a different bug that was introduced recently).