Solved PlayerRespawnEvent will not fire.

Discussion in 'Plugin Development' started by the_merciless, Mar 12, 2013.

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


    I cant figure out why, but my playerRespawnEvent always returns a NPE. Always on the same line, even if i add and remove code, so the line its pointing to is not the error. I have even deleted all my code leaving just a message in the event, and i still get an NPE. This is my code right now:

    @EventHandler (priority = EventPriority.HIGHEST)
        public void onrespawn(PlayerRespawnEvent e){ 
            Bukkit.broadcastMessage("respawn event");
    and heres the stacktrace:

    2013-03-13 00:14:53 [SEVERE] Could not pass event PlayerRespawnEvent to MercilessPvp v1.0.0[1.4.7]
        at org.bukkit.plugin.RegisteredListener.callEvent(
        at org.bukkit.plugin.SimplePluginManager.fireEvent(
        at org.bukkit.plugin.SimplePluginManager.callEvent(
        at net.minecraft.server.v1_4_R1.PlayerList.moveToWorld(
        at net.minecraft.server.v1_4_R1.PlayerList.moveToWorld(
        at net.minecraft.server.v1_4_R1.PlayerConnection.a(
        at net.minecraft.server.v1_4_R1.Packet205ClientCommand.handle(SourceFile:30)
        at net.minecraft.server.v1_4_R1.NetworkManager.b(
        at net.minecraft.server.v1_4_R1.PlayerConnection.d(
        at net.minecraft.server.v1_4_R1.ServerConnection.b(SourceFile:39)
        at net.minecraft.server.v1_4_R1.DedicatedServerConnection.b(SourceFile:30)
        at net.minecraft.server.v1_4_R1.MinecraftServer.r(
        at net.minecraft.server.v1_4_R1.DedicatedServer.r(
        at net.minecraft.server.v1_4_R1.MinecraftServer.q(
    Caused by: java.lang.NullPointerException
        at org.bukkit.craftbukkit.v1_4_R1.inventory.CraftInventory.setContents(
        at me.merci.MercilessPvp.Pvplistener.onrespawn(
        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)
        ... 16 more
    Nvm, i found the cause. I had an Unneeded jar hiding in my build path.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: May 31, 2016
Thread Status:
Not open for further replies.

Share This Page