Hello, When I try and save comments, they do not save at all, as I cannot use saveDefaultConfig(). I'm directly editing the Essential's config file, and saving it by doing config.save(xxxx). How would I get past the comment problem keeping in mind I'm not using the config file that my plugin would create. Thanks!
No I'm using Bukkit's config.save feature. I did save it. This one. EDIT by Moderator: merged posts, please use the edit button instead of double posting.
@Ravada As far as I know you can't really save the config (except default) with comments using the bukkit API. You would have to create your own. Or you could use google "bukkit save config with comments" and look around in the results you get. Im pretty sure you can get sth working with google. I don't know any, maybe some other forum user can enlighten us
@Ravada I don't think you can add comments. they are deleted when you save your file with your plugin. So if you don't store values in your file like esssentials, it should be good. Else, call me if you find a way
I need to keep the comments, or else they uncomment out some things which are supposed to be commented. Anyone else got any ideas?
@Ravada Create this class in your plugin use CommentedConfigureation()#Method to access methods. Use the save method to save.
Can you provide me an example with using ComentedConfiguration with a config that isn't in the same project?
Well here's what i usually do; put all the information in the header. If you simply do saveDefaultConfig() in your onEnable it will keep comments, until you use saveConfig() which will remove them.
How do you get it to work if the config file is not the plugin's default one, so you have to edit a different one?
@caderape I need the comments as some of the comments are required to keep the Essentials config working.
@Ravada Call me crazy, but I'm pretty sure comments are not read by the parser, and thus not necessary
@Ravada Essentials dont save the config file by itself. It's a file loaded but not saved. The comments will stay if the save is done by a player while editing the file.
This is nothing to do with Essentials. I'm saving something into the Essentials config, which removes all the comments for some reason.