Solved createConfig() returns NullPointerException?

Discussion in 'Plugin Help/Development/Requests' started by xXSon588Xx, Dec 31, 2014.

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


    So basically I have a config system that uses createConfig() to create a config. However, it keeps returning null when the server starts, resulting in a crash.

    My base class:
    My Config class:
    My error:

    I have another class that creates a player.yml, but I'm assuming it will create the same error.

    I tried using the config setup on the Bukkit Wiki but that even game me NullPointerException.

    I am completely stump.
  2. Offline


    I know it's null, but for some odd reason I can't figure out why. (Very sleepy right now and I just want to get this finished.)
  3. configFile = new File(plugin.getDataFolder(), "config.yml");
    add that before checking if configFile exists
  4. Offline



    If you look in the config class at line 35, I already added that.
  5. @xXSon588Xx
    yes, but if you want to use that, you must call MCEP_Config first.
    you`re calling createConfigs before of MCEP_Config. So configFile still being null.
  6. @xXSon588Xx Are that 2 different plugins? Why do all your classes extend JavaPlugin?
  7. Offline



    No, it's just 1 plugin. I must've been very tired when I wrote that. I removed the JavaPlugin extension from MCEP_Configs.


    I see what you're trying to say. Going to fix that now to see if the results change.

    Still having bad luck. I changed the Config file to how it is on the Bukkit wiki but I'm still getting an error. MCEP_Config is called before I believe and I don't know what else to do.


    Edit: Fixed the error.


    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Oct 31, 2016
Thread Status:
Not open for further replies.

Share This Page