I often update config in plugin . How to save old values but add on server new lines from updated config . For example Config v1 (on server) Code: Object1: 10 Config v2 (in plugin) Code: Object1: 15 Object2: 30 I want that when server administrator update plugin ,config for him should look so : Code: Object1: 10 Object2: 30 Really sry if i explaiend so bad
Code: if (!config.contains("Object2")) { config.set("Object2", 30); saveConfig(); } if you meant that. Or config.addDefault/config.setDefaults
@kvq Or alternatively, save the values as a list. You can get the list, add the element, then save the list to config again