Why isn't my code working? It just returns null;

Discussion in 'Plugin Development' started by ShadowWizardMC, Jun 1, 2014.

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


    Can someone guide me to why this piece of code is not working? I don't know what is wrong but everytime I join the game I am greeted by the words null in all white :(.

  2. Offline


    You're calling setupConfig somewhere, like in onEnable?
  3. Offline


    NathanWolf No, its called onEnabled so when the server loads.
  4. Offline


  5. Offline


    AoH_Ruthless Sorry I just read the first part lol sorry
    Sorry my bad! :D
  6. Offline


    You forgot to saveConfig (); after all the config.set (); lines
    Mrawesomecookie and NathanWolf like this.
  7. Offline


  8. Offline


    you're writing way too much code for this, you shouldn't be manually creating your config.yml, there are already methods on the JavaPlugin class to retrieve config.yml using defaults included in the jar. your code is probably interfering with that.
  9. Offline


    One problem I see so far is that you set VIP, MVP and PRO in the config file but when you're setting your variables, you are getting VIP, MVP and MVP+ from the config file and MVP+ doesn't exist.
  10. Offline

    1Rogue Retired Staff

    You create a new file after setting your values, which will lead to numerous problems. Also you said "onEnabled", was that a typo or is your method actually named onEnabled?
Thread Status:
Not open for further replies.

Share This Page