Saving XYZ to Config

Discussion in 'Plugin Development' started by bballheat, Jan 19, 2013.

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

    bballheat

    I'm very confused on config files and was wondering how to save the players xyz to the config after the use a command. Please help!
     
  2. Offline

    gomeow

  3. Offline

    bballheat

    I've read that, but I've been looking around and I'm starting to get a better understanding so I'll check it out again
     
  4. Offline

    Major_Derp

    bballheat
    If you already have a config setup, then just get the location, and save it to a string for the location X, Y, and Z then save that string to the config. If you need to know the basics for the config setup, then just reply back, and i can try to help more.
     
  5. Offline

    bballheat

    Major_Derp Ok so I have a config that gets generated but I am having trouble with saving the xyz. I need the xyz to be saved by player too
     
  6. Offline

    Major_Derp

    Post some of your code, and i could help a little better. Also so you want to save their coordinates on command? Or on event?
     
  7. Offline

    bballheat

    Major_Derp I want to save them on command.
    Config:
    Code:
        getConfig().options().copyDefaults(true);
        saveDefaultConfig();
    Command that will save location to config:
    Code:
            if(cmd.getName().equalsIgnoreCase("setlocation")){
                            Location location = player.getLocation();
                            playerLocation.put(player.getName(), player.getLocation().clone());
                                player.sendMessage(ChatColor.GREEN + "New location set at: X: " + Math.round(location.getX()) + " Y: " + Math.round(location.getY()) + " Z: " + Math.round(location.getZ()));
    }
    Help

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

    gomeow

    Only bump after 12 hours
     
Thread Status:
Not open for further replies.

Share This Page