Search code examples
javayamlbukkit

Cannot get YML variables that are not set programatically


So what I have done is I created a config as a resource in my jar. I successfully exported it to the right folder and everything. I am using bukkit/spigot because its for a plugin. My problem is, I cannot get variables' values if it is not set programmatically. Say I created all the config. I loaded it and everything. Say I wanted to get the variable. option.option1.

It would return null because this option was not set using the methods. I decided to test and set a variable option.test in the class. And I tried to get the value. It worked. Now I do not know why it won't load anything that isn't set in the program. I have searched te internet and found nothing at all. I don't know if any code is needed to be provided, but I am really stuck on this one.

Code:
getConfig().getString("option.option1"); //Returns null, this option is set by hand in the config
getConfig().getString("option.test"); //Gets the variable. This is set programitally.
Using getConfig().set("option.test", "COMPLETE");


Solution

  • Nevermind I fixed my own problem. It was just to do with some file loading/saving issues.