Topic category: Help with Minecraft modding (Java Edition)
I am currently trying to make an entity that's immobile when it is in any player's fov and moves when it isn't. How I'm working is I'm making an annex procedure that detects if the entity it's given is in any surrounding player's sight, it should return true if so. Then I call this annex procedure in my entity's "On entity tick update" procedure and use it to set/remove the target of my entity depending on the returned value.
Assuming the player fov is 100 degrees, this is the annex procedure
So basically I tried to make it find the perfect x y z angles the player should rotate to to look right at my entity and then check if the player's actual look angle is inbetween 100 degrees around the perfect x y z angles. Normally the player should glow when he's looking at the entity but he just doesn't. I feel like I'm close to making it work but idk what's wrong here.
Edit: So I tested it again and I do get the glowing effect actually... but only when I'm looking north? I really can't figure what's wrong
I also struggle to make those images work :/