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.
Related issues
is duplicated by
relates to
Attachments
Comments


Strongly related to (or duplicate of) MC-89006

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-89006 is about water preventing the mobs from pathfinding to their destination in the first place.

Couldn't reproduce in 15w44b.
Can you confirm it for the next snapshot ? I have corrected quite a few bugs in pathfinding and might have corrected this one as a side effect.

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).

Is this still an issue in the most recent versions (currently that is 1.10.2, or 16w42a) of Minecraft? If so, please update the affected versions and help us keeping this ticket updated from time to time. If you are the owner/reporter of this ticket, you can modify the affected version(s) yourself.
This issue relates to MC-104631.