Rotate a Player 360

Discussion in 'Plugin Development' started by MoeMix, Apr 15, 2014.

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

    MoeMix

    Hey guys. How would I be able to rotate a player 360 degrees? Would I simply just set the Yaw? Also, it shouldn't be quick I was hoping it would be a 360 degree rotation that lasts about 3 seconds so it's smooth. Thanks!
     
  2. Offline

    zDylann

    Just teleport the player with his exact location while adjusting the yaw. Don't forget to check what his yaw is first though. The ternary operator is useful for this.

    Here is an example of a player being turned around.
    Code:java
    1. Location flipped = new Location(p.getWorld(), p.getX(), p.getY(), p.getZ(), (p.getYaw() < 180 ? p.getYaw() - 180 : p.getYaw() + 180), p.getPitch());
     
Thread Status:
Not open for further replies.

Share This Page