Im playing Custom NPCS on 1.12.
and I want an NPC with his back to the player not to see and attack the player, even though the player is in his AggroRange. Like in a stealth game where the player can sneak close to an NPC as long as the NPC doesnt see the player. The option "MustSeeTarget" doesn't work because he always sees me, no matter if I am behind the NPC or if the NPC is looking directly at me. I think the option only refers to whether there are blocks between the NPC and the player that block the view.
Is it possible to create a field of view for the NPC with scripting, so that the NPC only attacks the player when he is directly looking in the direction of the player?
As an alternative, I thought that the NPC only has a low agrorange (for example 10 blocks) and if the NPC is then attacked by the player or sees the player within these 10 blocks, then the agrorange is increased to 64, so that the NPC does not directly cancel the agro as soon as you are 10 blocks away again (the NPC uses Range attacks). But is there a better solution?