Solved Rotation player

Discussion in 'Plugin Development' started by Konkz, Mar 17, 2014.

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

    Konkz

    Hey guys,

    I'm attempting to rotate a player in a random direction once the event is fired, but when I try to do

    Code:java
    1. int randomyaw = (int) (Math.random() * 360);
    2. p.getLocation().setYaw(randomyaw);


    It won't work, yet all the other events fire.
     
  2. Offline

    Minesuchtiiii

    I would do (double)
     
  3. Offline

    Voltex

    Full code?
     
  4. you need to teleport the player :
    int randomyaw = (int) (Math.random() * 360);
    p.teleport(p.getLocation.setYaw(randomyaw));
     
  5. Offline

    Konkz

    The method teleport(Location) in the type Entity is not applicable for the arguments (void)
     
  6. Offline

    Garris0n

    Create a location variable and set the yaw. You should actually read and understand the code instead of just pasting it in and complaining when it doesn't work.
     
Thread Status:
Not open for further replies.

Share This Page