Solved On Enable Error

Discussion in 'Plugin Development' started by messageofdeath, Sep 7, 2013.

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

    messageofdeath

    So this error comes up onEnable():113

    [​IMG]


    Code:java
    1. /*113*/getServer().getPluginManager().registerEvents(new playerListener(this), this);
    2. /*114*/getServer().getPluginManager().registerEvents(new signListener(this), this);
    3. /*115*/getServer().getPluginManager().registerEvents(new DamageSystemListener(this), this);


    The class
    [​IMG]
     
  2. Offline

    Jalau

    Give us the StackTrace: the part after the caused by: ....
    :)
     
  3. Offline

    messageofdeath

    That's the entire stacktrace
     
  4. Offline

    Jalau

    Hm, let me see ^^

    Try:
    public playerListener PlayerListener = new playerListener(this);
    And then:
    pluginManager.registerEvents(this.PlayerListener, this);

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

    messageofdeath

    k one sec
    same error

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

    Jalau

    Hm,
    restart your server? Sometimes reloads cause wierd errors....
     
  7. Offline

    messageofdeath


    happens on start too...
     
  8. Offline

    Jalau

    No idea sorry, i'm also tired it's 1 am for me now, if no one helps you i will try to check tomorrow again ^^
     
  9. Offline

    messageofdeath

    mbaxter
    Can you help with this extremely weird error i'm having?
     
  10. Offline

    Chinwe


    You shouldn't tahg admins for standard plugin help :'(

    Following Java convention, your classnames should be capitalised, ie PlayerListener, SignListener etc

    Can you post your onEnable()? It doesn't seem clear as to why it would throw a NPE from that line, unless 'this' is null :confused:
     
  11. Offline

    messageofdeath

    In the playerListener class if I remove all the code with this.instance it works. But those are required. I also tried making the instance of KFCPvP static in its own class and that didnt work either. Everything the code uses is implemented. Meaning nothings null.
     
  12. Offline

    Wolvereness Bukkit Team Member

    Your line numbers are mismatched. One of your listeners is listening to a custom / abstract event with no getHandlerList() method declared. Seeing how your player listener is listening to proper events, I can reliably say your line numbers are simply wrong and the problem is in either signListener or DamageSystemListener.

    Also, please... Use proper naming conventions and do NOT post screenshots; use http://gist.github.com
     
  13. Offline

    messageofdeath

    The line numbers weren't mismatched they were two different classes.

    As goes your explanation I thank you. I was however using custom events, and I thought I could get around it by using a class called CustomEvent to where that handles the handlerList so I don't have those extra methods in my event. I totally forgot I did that. I thank you very much.
     
  14. Offline

    LegoPal92

    What is line 113 of your main class, that contains what is null.

    EDIT: stupid me, nvm, let me look again

    EDIT2: Well, I see nothing wrong with this... I could just be misreading something blatantly obvious, but I'm getting nowhere, I'm sorry, I will watch this thread to see if I see something else, though, as it is late at night here.
     
  15. Offline

    messageofdeath

    It was in the original post in java syntax. Plus this has already been resolved by Wolvereness. He helped me already. Before you clicked this post it was Solved
     
Thread Status:
Not open for further replies.

Share This Page