Topic category: User side tutorials
First you need to download this procedure template I made:
https://drive.google.com/file/d/1hxILFI5FrdlkOIqzuT8a3t4p3DBaGeuB/view?usp=sharing
you will also need the Additions Plugin:
https://mcreator.net/plugin/93380/plugin-damage-source-plugin-forge-1192
Make sure to follow these instructions, they should be all you need. !!!You need to make the mob itself by yourself!!!
You don't need to tweak any of the numbers. You only need to adjust the circled values if you want to adjust the sensitivity of the sight detection, Example: if you want the mob to only stop chasing you if you look directly at it, you would need to set both values to about 0.05.
The block that sets the data parameter "watched" to 4 is only there to tell the mob if its being watched or not, you could replace it with a other block the only thing that matters is that you somehow tell your mob that it is on your screen.
I hope that I could help someone, even though it wasn't the most informative tutorial, the problem is that there is so much, both genius and bad math involved with this, that it would have been very hard to explain and understand.
also, feel free to comment questions and/or other stuff, like that something does not display correctly
How can I make it so that the effect is removed when the entity is not being looked at?
You need to make the "watched" value count down in your entity's tick update procedure. In case that you don't have a effect yet, you just need check if the "watched" value is over 0 and then apply some effect or, if you don't know how to make the value count down then just set the "watched" to itself minus 1.
how do i make a "integer data parameter"?
On the 5th page called "Synced Data" of your entity element, you can create new data parameters of different types, like for example "integer".