Mojira Archive
MCPE-182041

behavior.avoid_mob_type not respecting max_dist and max_flee

Setting max_dist and max_flee above the default values of 3 and 10 does not make any difference.

If a mob has max_dist and max_flee value of 24, the mob will only start fleeing once the target is within 3 blocks and will only flee up to 10 block away.

This can be seen easily by spawning a vanilla ocelot. In the behavior file, it is supposed to flee from players 10 block away. However, it won't start fleeing until the player is 3 blocks away.

This is extra obvious when setting the max_dist and max_flee higher in a behavior pack.

For example, when setting the Salmon behavior.json behavior.avoid_mob_type max_dist and max_flee to 24, the salmon will only start fleeing within 3 blocks and will stop at 10 blocks away.

This can also be recreated easily by using the Ocelot behavior.json and setting max_dist and max_flee to 24. The ocelot will only begin to flee at 3 blocks away and will stop at 10 blocks.

 

Expected behavior:
With max_dist set higher, mobs will start to flee from farther away. With max_flee set higher, mobs will flee to a greater distance. These values seem to be capped or hardcoded to 3 and 10 blocks and the fields are ignored.

I have attached a simple behavior pack below which increases the max_dist and max_flee of the Ocelot, Fish (cod), and Salmon mobs to 24. All will start to flee when the player is within 3 blocks and will stop running at 10 blocks away.
This can also be seen in the vanilla behavior where the Ocelot has max_dist 10, but it does not begin to flee until the player is 3 blocks away.

Unresolved

EwokSithLord747

2024-05-27, 12:33 PM

2025-01-30, 01:04 AM

13

7

Confirmed

750722

1.20.81 Hotfix, 1.21.2 Hotfix, 1.21.51 Hotfix

-