CommandHelper

CommandHelper

46.5k Downloads

Add last_damager to the cause array of player_death event

LadyCailinBot opened this issue ยท 6 comments

commented

CMDHELPER-2742 - Reported by Hekta

Add last_damager to the cause array of player_death event when provided (for example in "Hekta tried to swim in lava to escape '''Zombie'''").

commented

Comment by jb_aero

What is the Bukkit-side API for this?

commented

Comment by PseudoKnight

Since this is already done in entity_death, you could refer to that.

commented

Comment by jb_aero

I wrote that :P Both entity_death and player_death use the API for getting the last damager, but there currently isn't an API for "last different damager before that". Though this would be simple enough for someone to keep track of in their own code using entity_damage.

commented

Comment by PseudoKnight

Oh, last_damager, not lastdamagecause. My brain went the wrong direction and assumed he wanted that feature from entity_death, despite the very clear example. ;)

commented

Comment by jb_aero

I thought we'd already changed player_death's @event[cause] to be an array that looked like entity_damage's @event. Within that should be @event[cause][damager], if not I guess I forgot to do it :P

commented

Comment by PseudoKnight

Still no API for this, so given its age (and that you can script this yourself by saving the last damage event's damager or parsing the death message) I'm going to close this.