Certain mobs still move when more than 32 blocks away from the player
The bug
Ghasts, magma cubes, slimes, fish [...] and all the mob that don't use the traditional random strolling type movement that normal mobs use, can move outside the 32 blocks of range causing lag.
How to reproduce
- Spawn some zombies and some slimes
- Go in spectator mode
→ Zombies can't move, slimes can
Created Issue:
Mobs that don't use the traditional random strolling type movement, moves out of range.
Ghasts, Magma cubes, Slimes, Fishes [...] and all the mob that don't use the traditional random strolling type movement that normal mobs use, can move outside the 32 blocks of range causing LAG
How to reproduce:
- Spawn some Zombies and some Slimes
- Go in spectator-mode
- Zombies can't move, Slimes can.
Mobs that don't use the traditional random strolling type movement, moves out of range.Certain mobs still move when more than 32 blocks away from the player
Ghasts,
Magma cubes,Slimes,Fishes[...] and all the mob that don't use the traditional random strolling type movement that normal mobs use, can move outside the 32 blocks of range causingLAGHow to reproduce:
- Spawn some Zombies and some Slimes
- Go in spectator-mode
- Zombies can't move, Slimes can.
The bug
Ghasts, magma cubes, slimes, fish [...] and all the mob that don't use the traditional random strolling type movement that normal mobs use, can move outside the 32 blocks of range causing lag.
How to reproduce
- Spawn some zombies and some slimes
Go in spectator mode
→ Zombies can't move, slimes can
This affects axolotls, bats, bees, ender dragons (very likely intended), foxes, ghasts, goats, hoglins, magma cubes, phantoms, piglins, piglin brutes, slimes, turtles, vexes, villagers, withers and zoglins.
The bug
Most mobs seem to stop walking (do not wander around / pathfind randomly) when there is only a spectator player nearby. The mobs might start moving, but then eventually stop. They still rotate and can bob up and down, but eventually they never actually leave its position.
Though this is likely intended (MC-46843, MC-48868), it leads to potential gameplay issues as described in MC-202512 and MC-212687. It also behaves inconsistently, because if it is intended behavior, it should apply to all mobs (MC-136206).
Steps to reproduce
This can be reproduced by switching the gamemode from creative to spectator, or by simply remaining in spectator mode and summoning the mobs listed below.
Notes
Logging out and relogging seems to (temporarily) fix the issue for some mobs.
When mobs interact with one another (i.e. cats and rabbits, for example) they might actually move around until the interaction is completed (that is, for example, the cat kills the rabbit). Then the mob stops moving again. Other examples include villagers fleeing from illagers and striders moving around when it rains.
Fixing this issue (if it is not intended) improperly might cause severe performance issues.
Affected mobs
This affects the following mobs: blazes, cats, chickens, cows, creepers, dolphins (MC-202512), donkeys, drowned, elder guardians, endermen (only teleport, don't walk), endermites, evokers, fish (cod, salmon, pufferfish, tropical fish), guardians, horses (including skeleton and zombie horses), husks, illusioners, iron golems, llamas and trader llamas, mooshrooms, mules, ocelots, pandas (they only roll, but don't walk), parrots, pigs, pillagers, polar bears, rabbits, ravagers, sheep, silverfish, spiders and cave spiders, skeletons, snow golems, squids and glow squids (MC-212687), strays, striders, vindicators, wandering traders, witches, wither skeletons, wolves, zombie villagers, zombies and zombified piglins.
This does not affect: axolotls, bats, bees, ender dragons, foxes, ghasts, goats, hoglins, magma cubes, phantoms, piglins, piglin brutes, slimes, turtles, vexes, villagers, withers and zoglins. Shulkers and giants are not affected because they already don't move in creative.
Other mobs, if any, were not tested.
Analysis
Analysis by Chumbanotz provided in this comment.
Demonstration video
https://i.gyazo.com/6b6fd1ec394dcc0341cdd2eb5c8a280b.mp4
Can confirm that this issue is still present in 20w51a.
Can confirm in 1.17.1 Release Candidate 1.
Tested in single-player, in spectator mode (
MC-227635). This affects axolotls, bats, bees, ender dragons, foxes, ghasts, goats, hoglins, magma cubes, phantoms, piglins, piglin brutes, slimes, turtles, vexes, villagers, withers and zoglins. This does not affect fish anymore.Can confirm in 21w42a.
Can confirm in 1.21.