PlayerJoinEvent Error

Discussion in 'Plugin Development' started by edocsyl, Mar 24, 2012.

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

    edocsyl

    Hi All

    I got some error with the new Event System..

    How can i fix this error ??

    Code:
    2012-03-24 11:39:36 [SEVERE] Could not pass event PlayerJoinEvent to ServerNews
    org.bukkit.event.EventException
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:303)
        at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
        at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:459)
        at net.minecraft.server.ServerConfigurationManager.c(ServerConfigurationManager.java:132)
        at net.minecraft.server.NetLoginHandler.b(NetLoginHandler.java:129)
        at net.minecraft.server.NetLoginHandler.a(NetLoginHandler.java:94)
        at net.minecraft.server.Packet1Login.handle(SourceFile:68)
        at net.minecraft.server.NetworkManager.b(NetworkManager.java:229)
        at net.minecraft.server.NetLoginHandler.a(NetLoginHandler.java:48)
        at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:61)
        at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:554)
        at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:452)
        at net.minecraft.server.ThreadServerApplication.run(SourceFile:490)
    Caused by: java.lang.NullPointerException
        at me.edocsyl.ServerNews.ServerNewsPlayerListener.onPlayerJoin(ServerNewsPlayerListener.java:46)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301)
        ... 12 more
     
    
     
  2. Offline

    JayEffKay

    Code:
    Caused by: java.lang.NullPointerException
        at me.edocsyl.ServerNews.ServerNewsPlayerListener.onPlayerJoin(ServerNewsPlayerListener.java:46
    
    At line 46 of SeverNewsPlayerListener.java something goes wrong. It's likely one of the variables used in the line is not instantiated properly and is still null.
     
  3. Offline

    edocsyl

    I already check this.. but this isnt the problem
     
  4. Offline

    comp8nerd4u2

    We need some source code to diagnose the exact problem. NullPointerException only tells us that you tried to use a null reference as if it were an actual object (not null).
     
  5. Offline

    edocsyl

  6. Offline

    JayEffKay

    I don't believe you ;)

    line 46 of ServerNewsPlayerListener:
    Code:
    if(this.plugin.blNotifyOnPlayerJoin){
    
    If I'm wrong, please point out where you initialise the plugin variable.
    I don't see you defined a constructor for the listener either, which you kinda need if you want to make the variable point to your running plugin-object.
     
Thread Status:
Not open for further replies.

Share This Page