Open Nononitas opened 1 year ago
Pull request #132
Thanks for feeling inclined to contribute. I made the change to use the damage event a while ago because there was a specific scenario where the death event was insufficient... Tbh I don't really remember why anymore but I'll try to remember. It was some weird condition where the death wouldn't get logged, I think..
If a death event doesn't get fired, it's more of a bukkit bug.
What is missing:
Currently you are using the EntityDamageEvent to check if a player dies, rather then using the PlayerDeathEvent. The problem with this approach is that for example custom deaths from plugins won't get saved.
Specific changes to make:
Switch to PlayerDeathEvent and get the information for the death cause via event.getEntity().getLastDamageCause() (can be null)