private float getRotationY(double x, double y, double z) { double dis1 = y - (this.y + 1); double dis2 = Math.sqrt(Math.pow(x - this.x, 2) + Math.pow(z - this.z, 2)); return (float) ((Math.atan2(dis2, dis1) * 180D) / Math.PI) - 90F; }