I'm creating a mob and need help in fashioning a method that will return ture or false depending on weather the entity is in front of the player (ie within its the players selected FOV or 180 depending on what is easier).
I haven't dived right into the minecraft api/methods to know exactly where to start.
Check out EntityLiving.java. There's a function called canEntityBeSeen. You pass the function an entity, and it calculates if the entity calling the function can see the entity passed to it.
I proposed one method in your other thread. It involves calculating what the player's yaw and pitch need to be for the player to be directly looking at the mob, and then checking if the player's current yaw and pitch within X degrees from the "direct look" values.
I'm creating a mob and need help in fashioning a method that will return ture or false depending on weather the entity is in front of the player (ie within its the players selected FOV or 180 depending on what is easier).
I haven't dived right into the minecraft api/methods to know exactly where to start.
Thanks.
Builder Mobs 0.53
My Other Mods Here