Solved -

Discussion in 'Plugin Development' started by Deleted user, Jul 3, 2014.

Thread Status:
Not open for further replies.
  1. Offline

    Deleted user

    -
     
    Last edited by a moderator: Jan 20, 2015
  2. Offline

    Jogy34

    Code:java
    1.  
    2. //My own method, not a built in one.
    3. public void setYaw(float degrees)
    4. {
    5. //Both these belong to EntityLiving
    6. this.yaw = degrees; //I believe this corresponds to the body
    7. this.aO = degrees; //This should correspond to the head
    8. }
    9.  
    10. //And... just in case you want it
    11. public void lookAt(Location loc)
    12. {
    13. if(loc != null)
    14. {
    15. lastLookAt = loc;
    16. double d0 = loc.getX() - this.locX;
    17. double d1 = loc.getZ() - this.locZ;
    18. float f = (float) (Math.atan2(d1, d0) * 180.0D / 3.1415927410125732D) - 90.0F;
    19. this.setYaw(f);
    20. }
    21. }
    22.  
     
  3. Offline

    Deleted user

    -
     
    Last edited by a moderator: Jan 20, 2015
Thread Status:
Not open for further replies.

Share This Page