mojira.dev
MC-93276

Mobs steered by passenger Slimes walk to 0,0

Credit for discovery goes to Reddit user /u/JAZEYEN, as described in this thread: https://www.reddit.com/r/MinecraftCommands/comments/3tzhc0/something_intersting_you_might_want_to_try/

When a mob that uses the standard base AI is spawned with a Slime riding and steering it, it will immediately head directly towards x=0, z=0. Specifically, the northwest corner of the block at 0,0. It will not attempt to avoid obstacles in any way, instead walking off of cliffs and getting stuck on one-block-high ridges if they are between it and the origin. When it reaches the northwest corner of 0,0, it will endlessly spin in circles around the point.

This behavior is the same in all dimensions, and will continue even if 0,0 is in an unloaded chunk. Magma Cubes may be used instead of Slimes with no change to the effects. Removing the Slime at any time fully restores the mob to normal.

To reproduce, start a world with cheats and run the command

/summon zombie ~ ~ ~ {Invulnerable:1b,Passengers:[{id:slime,Invulnerable:1b}]}

Watch as the Zombie heads for the origin. Replace Zombie with any mob from the following list and run again, as many times as you want.

Tested, affects the following mobs:
Chicken, Cow, Mooshroom, Pig, Rabbit, Sheep, Villager*, Zombie, Skeleton, Spider, Cave Spider, Creeper, Enderman, Witch, Zombie Pigman, Blaze, Wither Skeleton, Endermite, Silverfish, Horse, Ocelot, Wolf, Iron Golem, Snow Golem, Wither**
* Villagers always run instead of walking when affected.
** Withers will rise continuously into the air to attack the Slime, but otherwise behave as described.

Tested, does not affect the following mobs:
Bat, Squid, Guardian, Ghast, Slime, Magma Cube, Ender Dragon

NOTE: I have done some testing, and this bug has existed since 15w38a, when passenger AI overriding was first added. However, I can not select that as an Affected Version.


Code analysis by @unknown can be found in this comment.

Linked issues

Attachments

Comments 15

Seems like a dupe (or maybe relates?) of MC-87573?

No, I tested it with slimes and levitation, they always move South, not to 0,0. So the reports probably only relate to each other.

I'm pretty sure I know what the source of this bug is, in general terms.

Most mobs use an AI system in which they look at where they are now, where their final destination is, and the terrain between those two points, then decide which of the surrounding blocks they should head towards first. After they reach it, they do the same thing over and over again, until their destination is reached or something else comes up. The point is, most mobs always keep in mind "this is the position I am headed towards right now." Slimes don't do this; they just jump forwards, rotating to face the player if one is nearby. So when the mob they are riding asks, "Where are we headed right now?" they don't have a valid answer, and the mob ends up heading for the default position (0,0,0).

Tested and confirmed for the new snapshot 16w02a. I've attached screenshots for my own results
Edit: While I was testing whether the Zombies ignore collisions with Villagers, one of the Zombies attacked a Villager, I think they can attack villagers if in reach, but then will go to 0,0. I will try to take a screenshot of this.

5 more comments

I have encountered this as well, in Version 1.13-pre7

I can not reproduce this with any of the mobs in Version 1.14.1

If performed in 18w43a with an Illager Beast would cause the game to freeze.

AjaxGb

(Unassigned)

Confirmed

(Unassigned)

slime

Minecraft 15w46a, Minecraft 15w47a, Minecraft 15w47b, Minecraft 15w47c, Minecraft 15w49a, ..., Minecraft 1.13-pre3, Minecraft 1.13-pre7, Minecraft 1.13, Minecraft 18w31a, Minecraft 1.13.1

Minecraft 1.14.1

Retrieved