mojira.dev
MC-145656

Attribute "follow_range" is not working for hostile mobs before they find the target

When you summon a hostile mob with /summon command and "Attributes" tag, the "follow_range" is ineffective, if you are far from this hostile mob, it won't chase you unless you close to it, just like their "follow_range" is default
The command is

/summon minecraft:skeleton ~ ~ ~ {Attributes:[{Name:generic.follow_range,Base:100}],PersistenceRequired:1}

Remember to change the time to night, or the skeleton will be burned to death

I don't know which version did this issue appeared, but it exactly didn't happen in 1.13

OK, I tested it again today, When the skeleton find you, the "follow_range" will be useful as usual, it will keep chaseing you unless you run out its changed "follow_range"(you set) not its default "follow_range", this bug will only happens before the hostile mobs find you.

Code analysis

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

Linked issues

Comments 27

Does MC-121013 describe your issue?

@[Mod] Neko They are different, my issue didn't happened to 1.13, but that issue did(actually it happen to newest snapshot and didn't be fixed)
And this issue is more serious than that, even if you are the same Y position with the skeleton, the "followRange" is still ineffective, unless you're close enough to it

Does lowering the followRange to around 100 help? Keep in mind that a value of 1,000 is extremely large, typically being more blocks in each direction than are loaded. This is going to cause the server to slow down tremendously while it calculates pathfinding for what amounts to every single loaded block. What you might be seeing is the server simply not responding in order to move the skeleton. Lowering the followRange will determine if that's the issue.

No, I have changed the "followRange" to 100, it's still ineffective

I have the same issue. Every value above 32 has no effect. And with some testing the standard followrange turned out to be 32-34, while testing a zombie walking towards a villager. However a smaller value for "followRange" like 20 or 30 does work properly. (This being tested in a superflat and normal world.) Like @Black_tea_RGO mentioned, in 1.13.2, "genetic.followRange" worked fine.

17 more comments

Wow, even after the huge Attribute rework and expansion of 1.20.6, this FIVE year old bug is not even assigned yet???? This is such a limiting bug for map makers. 

Seem not fixed in 24w33a, anyone can confirm ?

No, it's a change in the way you use commands.

Use /execute as @e run attribute @s minecraft:follow_range base set 100

Ooh ok, thanks for the clarification.

BLack_Tea_RGO

coschevi

Confirmed

Platform

Low

Commands, Mob behaviour

Minecraft 19w09a, Minecraft 19w11a, Minecraft 19w11b, Minecraft 19w12a, Minecraft 19w12b, ..., 24w05b, 24w13a, 24w14a, 1.20.5 Release Candidate 2, 1.21

24w33a

Retrieved