Hi, I'm having some issues with configs How can I: Save a certain part of a config without deleting everything else, Reload config properly Here is my set and reload code: PHP: $this->getConfig()->set("prefix",$args[1]);$this->getConfig()->save();$this->reloadConfig(); This works, but here is the before and after look of my config: Before: PHP: ---#Announcer Config File############################ Announcer ## By Samueljh1 #############################Note: All of these settings can be changed IN-Game!#It is highly reccomended that you use the commands instead!#Do '/announcer help' for a list of commands.prefix: "!"op-only: falseenabled: true... After: PHP: ---prefix: '#'op-only: falseenabled: true... Also, the config doesn't reload!
What do you mean the config doesn't reload? If you save() it, you don't need to reload it because it must be the same. Also, comments of the config are cleared if you do save(). If you want to keep them, don't use save().
So how can I save it with comments? Also, what I mean by it not reloading is after I reload and check, it gets the old value, not the new one.
1. You can't retain the contents after using save() AFAIK 2. You save() it, so values in the config are overwritten.