Spoiler: Code Code (Text): Variables.configWriter = new FileWriter(Variables.configFile); Variables.configWriter.write("This is a test"+ "\n"); Variables.configWriter.close(); reloadConfig(); @SuppressWarnings("deprecation") public static void reloadConfig() { InputStream defConfigStream = Variables.plugin.getResource("config.yml"); if (defConfigStream != null) { YamlConfiguration defConfig = YamlConfiguration.loadConfiguration(defConfigStream); Variables.configCfg.setDefaults(defConfig); } } The plugin creates the config the first time I reload it. BUT it's going to "load" the strings at the second reload... Does anyone has an idea why this happens?
Why are you abusing static; what type is 'Variables'? I'd imagine it only loads data on reload because it you have the code to load the data inside your reloadConfig() method. Don't indent code under a warning supression. We need more code to help you, and more information too.
I figured it out myself It was a simple mistake by using the default config in my variables class If someone has the same problem - here is the solution: simply use a YamlConfiguration: YamlConfiguration.loadConfiguration(YourFile); and not: yourPlugin.getConfig(); easy to go!