Hey, I'm trying to get the name of item used to kill a player, before you say p.getItemInHand() then no. Because the problem is when player, for example, shoots a bow and swaps to fish before it lands it will say killed by fish not Pro Elite Bow. I looked though the method and I could not really find anything of use, anything that I've missed or do I have to do it the long way around?
Try when the player fires a bow put the bows name in a hashmap with the players name, then on death if the cause was an arrow get the shooter get the hashmap get the name
Thanks. I know how to do it, was just making sure there was no method that I've missed such as PHP: @EventHandlerpublic void onPlayerDeath(PlayerDeathEvent e) {Player p = e.getPlayer();e.setDeathMessage("Player " p.getName() + " has died by a weapon named " + p.getDeathCause().getName());} Would be much more useful.