private boolean isEntityWithinPlayerFOV(EntityPlayer player, Entity entity){
// code used from the Enderman player looking code.
Vec3 vec3 = player.getLook(1.0F).normalize();
Vec3 vec31 = Vec3.createVectorHelper(entity.posX - player.posX, entity.boundingBox.minY + entity.height / 2.0F - (player.posY + player.getEyeHeight()), entity.posZ - player.posZ);
double d0 = vec31.lengthVector();
vec31 = vec31.normalize();
double d1 = vec3.dotProduct(vec31);
return d1 > 1.0D - 2.5D / d0;
// return d1 > 1.0D - 0.025D / d0;
}