Solved plugin.saveResource does nothing but NullPointerException

Discussion in 'Plugin Development' started by adamxp12, Apr 20, 2015.

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

    adamxp12

    I feel quite stupid posting this because I seem to be the only person who is having issues

    I want to have a custom config file and so I followed the wiki and I HAVE added the custom config file into my jar file before you say that is my problem (first thing I checked)
    yet when I run the plugin it always fails on plugin.saveResource giving a NullPointerException

    I did some googling but no one seems to have a solution, in fact 'plugin.saveResource' seems undocumented???

    Any ideas???

    Ok found the problem
    somehow missed initializing the plugin variable
    fixed by adding
    plugin = this;
    to my onEnable

    feel quite dumb for missing that :(
     
    Last edited by a moderator: Apr 20, 2015
Thread Status:
Not open for further replies.

Share This Page