Modifying Config with a command?

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

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

    Kabino

    Hey I am fairly new to java so I'm looking for some help. So far, I have created a Location using X, Y, and Z coordinates defined in config and they work. However, I don't want to change the numbers in config and would like a command like "/setlocation" to grab the Player's XYZ and update the ones in the config. Any help would be appreciated!
     
  2. Viper150
    You don't want to change number in the config but you also want to update them, how does that work? Just erase the file contents and rewrite them with the updated coordinates?
     
  3. Offline

    Kabino

    I want the values to update based on the players location. Let's say I stand at X:10 Y:10 Z:10, and the config says X:20Y:20Z:20. When I type /setlocation, the config will update to X:10Y:10Z:10 and then I can teleport back to there.

    EDIT: By saying "I dont want to change the numbers in the config" I mean, I dont want to change it Manually
     
  4. Viper150
    Ah ok, in that case just delete the file and recreate it with the new values. I am assuming you know how to program basic file IO in the first place, if not I suggest you check out my link to the Plugin tutorial on the wiki in my signature.
     
Thread Status:
Not open for further replies.

Share This Page