I have Code (Text): @EventHandler public void onDeath(PlayerDeathEvent e) { e.setDeathMessage(ChatColor.RED + e.getEntity().getDisplayName() + " was killed by " + e.getEntity().getKiller().getDisplayName() + " with " + e.getEntity().getKiller().getHealth() + " hearts!"); } But it gives me an error on .getHealth() The method getHealth() is ambigous for the type Player Thanks - Flo
Killer is null if the killer wasn't a Player (assuming that getHealth as field in the code was a typo)
Oh, that is what I did. I will edit it now, I am on my iPad right now, so that code was just my dumb self trying to remember what I typed
Well, is getEntity even a method inside PlayerDeathEvent, isn't it getPlayer?Eclipse should be able to help you with these kinds of things.
@FloThePony take a screenshot of your IDE, and preferably post what your IDE shows when you hover over the red lined text.
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/entity/PlayerDeathEvent.html#getEntity(), Also if you're importing craftbukkit set it to a lower build priority inside your IDE.