Question How to get the killer of any player if this is an entity [EntityDeathEvent]

CarlosDiamon

New member
Jun 12, 2023
1
0
1
I was modifying the death messages when a player is killed in any case (by another player, entity or crash) and i have seen that the event.getEntity().getKiller(); it only returns if it is a player and null if it is not clearly, seeing in forums some use the EntityDamageByEntityEvent and check if this entity dies with the damage received (it would work for me but if it dies by falling there it does not work for me), I want to know if it can There is a better option.
 
Last edited: