PlayerDeathEvent could not pass error

Discussion in 'Plugin Development' started by Payless, Apr 13, 2016.

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

    Payless

    Code:
    [16:42:07 ERROR]: Could not pass event PlayerDeathEvent to Deathbans v1.0
    org.bukkit.event.EventException
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:302) ~[spigot.jar:git-Spigot-1649]
            at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-1649]
            at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:514) [spigot.jar:git-Spigot-1649]
            at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:499) [spigot.jar:git-Spigot-1649]
            at org.bukkit.craftbukkit.v1_7_R4.event.CraftEventFactory.callPlayerDeathEvent(CraftEventFactory.java:397) [spigot.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.EntityPlayer.die(EntityPlayer.java:386) [spigot.jar:git-Spigot-1649]
            at org.bukkit.craftbukkit.v1_7_R4.entity.CraftLivingEntity.setHealth(CraftLivingEntity.java:85) [spigot.jar:git-Spigot-1649]
            at org.bukkit.command.defaults.KillCommand.execute(KillCommand.java:33) [spigot.jar:git-Spigot-1649]
            at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:181) [spigot.jar:git-Spigot-1649]
            at org.bukkit.craftbukkit.v1_7_R4.CraftServer.dispatchCommand(CraftServer.java:767) [spigot.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.PlayerConnection.handleCommand(PlayerConnection.java:1043) [spigot.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.PlayerConnection.a(PlayerConnection.java:880) [spigot.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.PacketPlayInChat.a(PacketPlayInChat.java:28) [spigot.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.PacketPlayInChat.handle(PacketPlayInChat.java:65) [spigot.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.NetworkManager.a(NetworkManager.java:186) [spigot.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.ServerConnection.c(ServerConnection.java:81) [spigot.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.MinecraftServer.v(MinecraftServer.java:734) [spigot.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.DedicatedServer.v(DedicatedServer.java:289) [spigot.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.MinecraftServer.u(MinecraftServer.java:584) [spigot.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.MinecraftServer.run(MinecraftServer.java:490) [spigot.jar:git-Spigot-1649]
            at net.minecraft.server.v1_7_R4.ThreadServerApplication.run(SourceFile:628) [spigot.jar:git-Spigot-1649]
    Caused by: java.lang.NullPointerException
            at Deathbans.DeathBanListener.onDeath(DeathBanListener.java:117) ~[?:?]
            at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_77]
            at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_77]
            at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:1.8.0_77]
            at java.lang.reflect.Method.invoke(Unknown Source) ~[?:1.8.0_77]
            at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:298) ~[spigot.jar:git-Spigot-1649]
            ... 20 more
    [16:42:07 INFO]: Payless[0] died.
    >op Payless
    [16:42:15 INFO]: CONSOLE: Opped Payless
    >
    
    I dont know why no errors in my classes all commands are working i cant get banned for dieing someone help
     
  2. Offline

    ShowbizLocket61

    @Payless
    What is line 117 of DeathBanListener? Imports and empty lines included.
     
  3. Offline

    Payless

    Code:
    this.deathWrappers.put(e.getEntity().getUniqueId(), new DeathWrapper(e.getEntity(), killer.getName(), deathBanTime));
     
  4. Offline

    Zombie_Striker

  5. Offline

    Payless

  6. Offline

    Zombie_Striker

    @Payless
    These are the most important lines here. Something is null at line 117. Let me go through all the variables you referenced there:
    • deathWrappers can be null
    • The entity cannot be null
    • Killer can be null
    • death ban time cannot be null if it is an int.
    Null check deathWrappers and killer. Post which one is null, and try initializing that variable.
     
Thread Status:
Not open for further replies.

Share This Page