Error in console -=[OnDeathEvent]=-

Discussion in 'Plugin Development' started by QuipCream, Feb 26, 2014.

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

    QuipCream

    Hello, I created this kitpvp plugin for my server and everytime I die, it seems to bring this error into the console. I'm partially new to Java and coding, so I don't really know what this means.. If one of you could help me out here, that would be great.

    Error/Console Log:
    26.02 05:11:11 [Multicraft] Skipped 12 lines due to rate limit (30/s)
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.DedicatedServer.u(DedicatedServer.java:250) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.MinecraftServer.u(MinecraftServer.java:637) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.WorldServer.tickEntities(WorldServer.java:480) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.World.tickEntities(World.java:1217) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.World.playerJoinedWorld(World.java:1329) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.World.entityJoinedWorld(World.java:1348) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.EntityZombie.h(EntityZombie.java:214) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.EntityMonster.h(EntityMonster.java:24) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.EntityInsentient.h(EntityInsentient.java:150) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.EntityLiving.h(EntityLiving.java:1299) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.EntityZombie.e(EntityZombie.java:152) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.EntityMonster.e(EntityMonster.java:20) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.EntityInsentient.e(EntityInsentient.java:306) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.EntityLiving.e(EntityLiving.java:1436) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.EntityInsentient.bn(EntityInsentient.java:427) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.PathfinderGoalSelector.a(PathfinderGoalSelector.java:108) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.PathfinderGoalMeleeAttack.e(PathfinderGoalMeleeAttack.java:100) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.EntityZombie.m(EntityZombie.java:218) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.EntityMonster.m(EntityMonster.java:99) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.EntityPlayer.damageEntity(EntityPlayer.java:446) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.EntityHuman.damageEntity(EntityHuman.java:746) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.EntityLiving.damageEntity(EntityLiving.java:732) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at net.minecraft.server.v1_7_R1.EntityPlayer.die(EntityPlayer.java:368) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at org.bukkit.craftbukkit.v1_7_R1.event.CraftEventFactory.callPlayerDeathEvent(CraftEventFactory.java:349) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:486) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:501) [craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) ~[craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:294) ~[craftbukkit_beta.jar:git-Bukkit-1.7.2-R0.3-2-g85f5776-b3023jnks]
    26.02 05:11:02 [Server] INFO org.bukkit.event.EventException
    26.02 05:11:02 [Server] ERROR Could not pass event PlayerDeathEvent to EchoKitPvP v1.0


    PlayerDeathEvent Code:

    Code:java
    1. @EventHandler
    2.  
    3. public void Death(PlayerDeathEvent e){
    4. Player p = (Player)e.getEntity();
    5.  
    6. kit.remove(p.getName());
    7.  
    8. pvp.remove(p.getName());
    9.  
    10. archer.remove(p.getName());
    11.  
    12. p.getInventory().clear();
    13.  
    14. p.getInventory().setHelmet(new ItemStack(Material.AIR));
    15.  
    16. p.getInventory().setChestplate(new ItemStack(Material.AIR));
    17.  
    18. p.getInventory().setLeggings(new ItemStack(Material.AIR));
    19.  
    20. p.getInventory().setBoots(new ItemStack(Material.AIR));
    21.  
    22. p.teleport(new Location(p.getWorld(), 287, 70, 424));
    23. }
    24.  


    PS: I know I probably messed up on inserting the code, but please don't comment on it, unless if it's actually important, Thanks.
     
  2. Offline

    mattibijnens

  3. Offline

    TwerkinCraft

    Are you sure e.getEntity is getting the Player and not what killed it? because it is a PlayerDeathEvent, and if it is getting what died, you will have to remove the player cast there and change p to an entity, then do
    "if(p instanceof Player){ "
    and if p is a Player,
    "Player (anything but p) = e.getEntity();"
     
  4. Offline

    nitrousspark

    are you trying to disable the respawn screen? thats what it looks like to me. theres a better way to do it here, also, maybe the lists your trying to remove them from (kit, pvp, or archer) are empty.
     
  5. Offline

    AoH_Ruthless

    TwerkinCraft
    Actually you can cast that without checking the instance because getEntity() returns Player in PlayerDeathEvent.

    QuipCream
    That doesn't work because you can't teleport someone since they will be on the respawn screen. You have to disable the screen and then teleport them. If you don't want to disable the screen (which can require extra work), teleport the player in a PlayerRespawnEvent.
     
  6. Offline

    QuipCream

    AoH_Ruthless How do I disable the respawn screen?

    EDIT: Nevermind, I found out how. Thanks guys.
     
Thread Status:
Not open for further replies.

Share This Page