When modifying the component problem with the component minecraft:behavior.avoid_mob_type on any entity, whether it's from the game itself or a new custom one, the component doesn't result in the expected behaviors correctly. Most of the component's defined parameters don't affect anything at all, like max_flee, for example. Or others that don't work well at high values or don't work properly, like avoid_target_xz. Everything "works" in a weird, broken, unexpected, and inconsistent way that's hard to actually explain. The component should be tested by changing all possible parameters, using it inside entity_types and outside. The documentation should be clearer too.
But to sum it all up, the entity always runs away at most up to a maximum distance of 10 blocks and starts running when you get close to it within 3 blocks, it seems like the values are hardcoded.
We're tracking this issue at MCPE-182041, so I will resolve and link this report as a duplicate.
If you have new information to share, please leave a comment on the linked report. If not, add a vote to the report to show that you are affected.
If you haven't already, please make sure to search before creating a report to see if the issue has already been reported. See the Bug Tracker Guidelines for tips on searching for issues.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki