Pitch and Yaw setting

Discussion in 'Plugin Development' started by crushh87, Feb 2, 2013.

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

    crushh87

    So I'm trying to get the Pitch and Yaw of the player setting a location.
    This gives no error but every time you teleport your looking straight up.
    Code:java
    1.  
    2. int Pitch = getConfig().getInt("lobbyLoc.Pitch");
    3. int Yaw = getConfig().getInt("lobbyLoc.Yaw");
    4.  


    Is this the best way too do this or is there a better way?

    Edit: I'm guess I need to save them as a Floats but how?
     
  2. Offline

    CubixCoders

    Code:java
    1.  
    2. float pitch = getConfig().getFloat("lobbyloc.Pitch");
    3. float yaw = getConfig().getFloat("lobbyloc,Yaw");
    4.  
     
  3. Offline

    crushh87

    The method getFloat(String) is undefined for the type FileConfiguration
    CubixCoders
     
  4. Offline

    CubixCoders

    getConfig().getInt("lobbyloc.Yaw");
     
  5. Offline

    crushh87

    Read the original post.....
    Code:java
    1.  
    2. int Yaw = getConfig().getInt("lobbyLoc.Yaw");
    3.  
     
  6. Offline

    CubixCoders

    Code:java
    1.  
    2. float Yaw = getConfig().getInt("lobbyLoc.Yaw");
    3.  
     
  7. Offline

    crushh87

    Type mismatch: cannot convert from int to Float
    CubixCoders
     
  8. Offline

    CubixCoders

    In a plugin i made this code
    Code:
    float yaw = cfg.getInt(world + "." + pName + ".Yaw");
    
    works.
     
  9. Offline

    crushh87

    Should of thought of this but apparently Float and float are completely different lol thanks doubts

    This would be correct right?
    Location lobbyspawn = new Location(w, x, y, z, Pitch, Yaw);

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 31, 2016
  10. Offline

    CubixCoders

  11. Offline

    crushh87

    Still having trouble getting it too work.... this whole location thing is a pain in the ass...
     
  12. Offline

    chasechocolate

    Why do you even need the pitch and yaw?
     
  13. Offline

    crushh87

    So the players are facing the right way when they are teleported...
     
Thread Status:
Not open for further replies.

Share This Page