I want to order by keys in config.yml. Right now, Im doing this: boolean KEY1 = true, KEY2 = true; config.load(); KEY1 = getConfiguration().getBoolean("KEY1", KEY1); KEY2 = getConfiguration().getBoolean("KEY2", KEY2); config.setProperty("KEY1", KEY1); config.setProperty("KEY2", KEY2); config.save(); But that outputs the keys in a random order. How do I control this? Another thing, is it possible to make comments? Something like: config.createComment("Derp");
This is an old post, but I want to do the same thing. I'm probably gonna prep-end every key/value set by their index. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
You can now make a config.yml, compile it into your Jar with everything else, then use saveDefaultConfig() to have it pulled out and saved exactly how you originally created it.