Solved What's wrong?

Discussion in 'Spigot Plugin Help' started by KayohiPlay, Jun 23, 2016.

  1. Im getting error but i dont know why


    [16:22:11] [Server thread/ERROR]: Could not pass event PlayerDeathEvent to SkyPvP v1.0
    org.bukkit.event.EventException
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:305) ~[spigot.jar:git-Spigot-13716d9-0899683]
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[spigot.jar:git-Spigot-13716d9-0899683]
    at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502) [spigot.jar:git-Spigot-13716d9-0899683]
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487) [spigot.jar:git-Spigot-13716d9-0899683]
    at org.bukkit.craftbukkit.v1_8_R1.event.CraftEventFactory.callPlayerDeathEvent(CraftEventFactory.java:381) [spigot.jar:git-Spigot-13716d9-0899683]
    at net.minecraft.server.v1_8_R1.EntityPlayer.die(EntityPlayer.java:407) [spigot.jar:git-Spigot-13716d9-0899683]
    at net.minecraft.server.v1_8_R1.EntityLiving.damageEntity(EntityLiving.java:774) [spigot.jar:git-Spigot-13716d9-0899683]
    at net.minecraft.server.v1_8_R1.EntityHuman.damageEntity(EntityHuman.java:801) [spigot.jar:git-Spigot-13716d9-0899683]
    at net.minecraft.server.v1_8_R1.EntityPlayer.damageEntity(EntityPlayer.java:486) [spigot.jar:git-Spigot-13716d9-0899683]
    at net.minecraft.server.v1_8_R1.EntityLiving.O(EntityLiving.java:1141) [spigot.jar:git-Spigot-13716d9-0899683]
    at net.minecraft.server.v1_8_R1.Entity.K(Entity.java:325) [spigot.jar:git-Spigot-13716d9-0899683]
    at net.minecraft.server.v1_8_R1.EntityLiving.K(EntityLiving.java:163) [spigot.jar:git-Spigot-13716d9-0899683]
    at net.minecraft.server.v1_8_R1.Entity.s_(Entity.java:245) [spigot.jar:git-Spigot-13716d9-0899683]
    at net.minecraft.server.v1_8_R1.EntityLiving.s_(EntityLiving.java:1406) [spigot.jar:git-Spigot-13716d9-0899683]
    at net.minecraft.server.v1_8_R1.EntityHuman.s_(EntityHuman.java:173) [spigot.jar:git-Spigot-13716d9-0899683]
    at net.minecraft.server.v1_8_R1.EntityPlayer.l(EntityPlayer.java:282) [spigot.jar:git-Spigot-13716d9-0899683]
    at net.minecraft.server.v1_8_R1.PlayerConnection.a(PlayerConnection.java:366) [spigot.jar:git-Spigot-13716d9-0899683]
    at net.minecraft.server.v1_8_R1.PacketPlayInFlying.a(SourceFile:126) [spigot.jar:git-Spigot-13716d9-0899683]
    at net.minecraft.server.v1_8_R1.PacketPlayInPosition.a(SourceFile:57) [spigot.jar:git-Spigot-13716d9-0899683]
    at net.minecraft.server.v1_8_R1.PacketHandleTask.run(SourceFile:13) [spigot.jar:git-Spigot-13716d9-0899683]
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [?:1.7.0_80]
    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [?:1.7.0_80]
    at net.minecraft.server.v1_8_R1.MinecraftServer.z(MinecraftServer.java:683) [spigot.jar:git-Spigot-13716d9-0899683]
    at net.minecraft.server.v1_8_R1.DedicatedServer.z(DedicatedServer.java:316) [spigot.jar:git-Spigot-13716d9-0899683]
    at net.minecraft.server.v1_8_R1.MinecraftServer.y(MinecraftServer.java:623) [spigot.jar:git-Spigot-13716d9-0899683]
    at net.minecraft.server.v1_8_R1.MinecraftServer.run(MinecraftServer.java:526) [spigot.jar:git-Spigot-13716d9-0899683]
    at java.lang.Thread.run(Thread.java:745) [?:1.7.0_80]
    Caused by: java.lang.NullPointerException
    at me.bukkittnt.skypvp.Events.onDeath(Events.java:51) ~[?:?]
    at sun.reflect.GeneratedMethodAccessor247.invoke(Unknown Source) ~[?:?]
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_80]
    at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_80]
    at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:301) ~[spigot.jar:git-Spigot-13716d9-0899683]
    ... 26 more

    I think that im getting from this code

    }

    @EventHandler
    public void onDeath(PlayerDeathEvent e) {
    Player p = (Player) e.getEntity();
    Player k = p.getKiller();
    k.getInventory().addItem(new ItemStack(Material.EMERALD, 1));

    }
     
  2. The problem seems to be with SkyPVP, either update or report the issue to the author
     
  3. If the player falls into the void (or something else, but not killing by a player), the killer will be null.
     
  4. How can i fix it? becouse my whole console is spammed by this error
     
  5. Make a query, if killer is not null -> +1 Emerald.
     
  6.  
  7. Developer send me this plugin + source code and now he's gone :D idk what to do. (I'm not coding)
     
  8. I do not like to paste codes, but it is one query, because of this - here:
    Code (Text):
    if ( k != null )
     
  9. Problem soveld, thanks to ChefJava