getDataFolder() problems...

Discussion in 'Plugin Development' started by simpin1997, Oct 21, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    simpin1997

    Hey,
    i am having some problems with the getDataFolder() command. This is the error in the console:
    My de.simpin1997.mainConfig.mainConfig:
    My de.simpin1997.main.main:

    Can anyone help me? And sorry for my english. I am german :D
     
  2. Offline

    Minecrell

    simpin1997
    You need to initialize the config inside your onEnable method. If you put it outside of it, it will be called before the plugin is enabled and it won't work.
    So change the two lines above onEnable to this:
    Code:java
    1. mainConfig mainConfig;
    2. FileConfiguration getMainConfig;
    And set them in your onEnable instead:
    Code:java
    1. // onEnable
    2. mainConfig = new mainConfig();
    3. getMainConfig = mainConfig.getConfig();

    Why are you using a XML file as a YAML file?
     
  3. Offline

    simpin1997

  4. Offline

    Minecrell

Thread Status:
Not open for further replies.

Share This Page