Teleport including player orientation?

Discussion in 'Plugin Development' started by SunShe, Mar 15, 2011.

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

    SunShe

    I wanted to know if they have a way to teleport a player with keeping him orientation? I know how to teleport a player but it reset the orientation. Maybe an information at add to Location?
     
  2. Offline

    Drakia

    To keep orientation when you're making your new Location object, set it's Yaw:
    Code:
    Location loc = new Location(world, x, y, z);
    loc.setYaw(player.getLocation().getYaw());
    Code off the top of my head so may need adjustment.
     
  3. Offline

    SunShe

    Thank you so much i will try, it's for a new plugin :p
     
  4. Offline

    Drakia

    If you also want to set their up/down facing, then do the same thing but with Pitch instead of Yaw.
     
Thread Status:
Not open for further replies.

Share This Page