Solved Directions with teleport help

Discussion in 'Plugin Development' started by RedstoneForDayz, Aug 5, 2014.

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

    RedstoneForDayz

    I know there is another post about this, but I need help. In my code, the player clicks on a egg, and goes to hub. How can I make it so they face North when they teleport? Here is a piece of the code:
    Code:java
    1. if (event.getCurrentItem().getType() == Material.EGG) {
    2. World world = Bukkit.getWorld("world");
    3. Location Hub = new Location(world, -62.5, 72, 208.5);
    4. p.teleport(Hub);
    5. return;
     
  2. Offline

    Gamecube762

    Look into Pitch and Yaw, those are what defines what direction the player is looking and you can .setPitch() and .setYaw() on the Location.
     
Thread Status:
Not open for further replies.

Share This Page