/kill and /suicide commands do not set the last damage cause for the affected player

Description

Apologies, I opened this issue over on https://essentials3.atlassian.net and I have no way to edit/delete it, so I'm posting it again here.

  • The Essentialls /kill and /suicide commands do not set the last damage cause for the affected player

  • Third-party plugins often call Player.getLastDamageCause() within the onPlayerDeath event to determine the cause of death

  • If the player died due to the Essentialls /kill or /suicide commands, Player.getLastDamageCause() returns null in this context, instead of returning an EntityDamageEvent as it should

Suggested fix: call player.setLastDamageCause(event) within the /kill and /suicide command handlers, before applying the damage to the player

Environment

Essentials: 2.13.1 CraftBukkit: 1.7.2-R0.3

Assignee

RobertG

Reporter

Anonymous

Priority

Normal
Configure