Error with config- urgant

Discussion in 'Plugin Development' started by naorpeled, Apr 13, 2014.

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

    naorpeled

    onEnable:
    Code:Java
    1.  
    2. public void onEnable()
    3. {
    4.  
    5.  
    6. Timer.startRef();
    7. [Irrelivant code]
    8. FileConfiguration config = this.getConfig();
    9. config.options().copyDefaults(true);
    10. saveConfig();
    11. }
    12.  

    Timer.class:
    Code:Java
    1.  
    2. final String worldname = plugin.getConfig().getString("preferences.feastworld");
    3.  

    http://gyazo.com/1bda4bd64124404c3ce5407f2704b9e3
    [​IMG]

    #Bump

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 7, 2016
  2. Offline

    thomasb454

    Please only bump your posts once every 24 hours.

    Post the error in paste bin (or similar) format.
     
  3. Offline

    naorpeled

    I gave a link....
     
  4. Offline

    thomasb454


    I'm not reading an error off of a screenshot. You can find the error in your server log.
    If you want my help, please provide the info the way I want it. :)
     
  5. Offline

    pookeythekid

    Okay, you have an error with your config. Mind proving any kind of description to it? Besides, the stack trace in the console tells you where the error in the code is, so you can find it yourself. Otherwise, the best I can tell you is that you just use "getConfig()" in every place that you use "config".
     
  6. naorpeled
    According to the error, the string that you're trying to get from your config is null.
     
  7. Offline

    naorpeled

    TheGamingGrunts I`ve fixed it but I have one more problem@​
    Code:Java
    1.  
    Code:Java
    1.  
    2. [LEFT] Bukkit.getScheduler().runTaskLater(plugin, new Runnable()[/LEFT]
    3. [LEFT]static m(Main class) plugin;[/LEFT]
    4. [LEFT][/LEFT]
    it just throws an exception​
     
  8. Offline

    Slendemic

    Something seems odd about this line:
    Code:java
    1. Bukkit.getScheduler().runTaskLater(plugin, new Runnable()
     
  9. Offline

    naorpeled

    What`s weird about it?
     
  10. Offline

    Slendemic

    Have you considered closing it? :p
     
  11. Offline

    naorpeled

    I already did, I gave you all the code that you actually need to know about.
     
  12. Offline

    naorpeled

  13. naorpeled Play a game of count the parenthesis :)
     
  14. Offline

    naorpeled

    I didn`t forget any parenthesis.
     
  15. naorpeled Have you looked at the last code that you posted? It's incomplete and doesn't make much sense.
     
  16. Offline

    naorpeled

    Which one ? ;P
     
  17.  
  18. Offline

    mrcal17

    You forgot the semicolin after:
    1. Bukkit.getScheduler().runTaskLater(plugin, new Runnable()
     
  19. mrcal17 He forgot more than just that :p
     
  20. Offline

    naorpeled


    U
    I didn`t give you the whole code -_-
     
Thread Status:
Not open for further replies.

Share This Page