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

    ShadowWizardMC

    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 :(.

    [​IMG]
     
  2. Offline

    NathanWolf

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

    ShadowWizardMC

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

    AoH_Ruthless

  5. Offline

    ShadowWizardMC

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

    SmileyCraft

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

    ShadowWizardMC

  8. Offline

    metalhedd

    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

    pluginsbyjason

    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

    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