Isues with Locations.

Discussion in 'Plugin Development' started by ICodeMaster, Dec 8, 2013.

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

    ICodeMaster

    I am using the 1.7.2 build but i believe it's more of a problem i can't solve then an issue.
    I need to set the direction the play is looking. So i am trying to use this:

    Code:java
    1. if(is.equals(item.up())){
    2. Location newl = p.getLocation().setYaw(0);
    3. evt.setCancelled(true);
    4. p.teleport(newl);
    5. }


    (Note: The event is a PlayerItemHeldEvent to detect when the player is holding the directional item)

    The newl is throwing an error in eclipse that says i can't use that line.

    My main question is: How do i set the yaw if not by that?
     
  2. Offline

    Darq

    Location newl = p.getLocation();
    newl.setYaw(0);
    p.teleport(newl);
     
  3. Offline

    ICodeMaster


    That was super obvious. Thank!
     
  4. Offline

    The_Doctor_123

    ICodeMaster
    Follow what Darq said. This is what the JavaDocs says:
     
Thread Status:
Not open for further replies.

Share This Page