mojira.dev
MC-95727

Mobs with high follow range cause extreme lag

If you use commands to summon mobs with high follow range (such as this one:

/summon Zombie ~ ~1 ~ {Attributes:[{Name:generic.followRange,Base:160}]}

There is extreme lag when they are attempting to pathfind to players in adventure or survival mode. It appears to get much worse the more mobs are there. The lag is the type when the world becomes unresponsive (i.e. hitting mobs is nearly impossible, blocks keep coming back when you break them, there is delays when you type commands...). There is no fps drop involved with this lag.

Steps to Reproduce:
1. Use the above command to summon a mob. (Or a bunch of them)
2. Go a distance away and switch to survival or adventure, making sure the mobs are visible (so they can see you).
3. Intense lag ensues.

This bug relates to MC-94438, however, it is not the cause of that other bug, because this bug would only occur on custom maps with custom mobs that have increased follow range. The various mob pathfinding changes in the 1.9 snapshots are likely the causes of these bugs.

Linked issues

Comments 4

Duplicate of MC-60182.

The various mob pathfinding changes in the 1.9 snapshots are likely the causes of these bugs.

This is an issue present in all versions that use generic.followRange. You're asking the server to perform much heavier calculations the higher you increase the value, so it's only natural that the more work you ask it to do the longer it takes to do that work.

This is an issue present in all versions that use generic.followRange.

Considering spawning 20 Zombies with a 160 block follow range in version 1.8.9 creates no noticeable lag whatsoever whereas spawning only one in 16w02a makes the game basically unplayable, I find that very hard to believe.

@@unknown I'm saying that increasing followRange has always been a problem, and the act of doing so is a duplicate of MC-60182. The report he linked (MC-94438) covers mob AI issues in 1.9.

Why is this marked as a duplicate? Spawning a zombie with 1000 follow range (as highlighted in MC-60182) would crash it, but that large amount is never needed, since mobs won't move at all while outside your render distance (which can only go up to 32 chunks, or 512 blocks). A much smaller value of 160 is much more practical for making a map where hostile mobs spawn at a distance and come towards you. This doesn't crash or cause lag in 1.8.9, even if applied to a ton of mobs, but in the 1.9 snapshots it causes lag even if only put on a handful of mobs, rendering the game unplayable. So something changed, thus taking out a useful feature of allowing mobs to follow players from large distances.
Plus, it's totally broken a map that I've been working on for nearly a year.

Cavinator1

(Unassigned)

Unconfirmed

attribute, attributes, entities, entity, followRange, lag, mob

Minecraft 16w02a

Retrieved