Call EntityDeathEvent for EnderDragon#kill#8839
Conversation
| @Override | ||
| public void kill() { | ||
| + // Paper start | ||
| + org.bukkit.event.entity.EntityDeathEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, drops); // Paper - call event |
There was a problem hiding this comment.
I'm not sure we should pass in the drops field here. It looks like the ender dragon should drop nothing here, so passing in a list that might have something in it, might not is misleading.
Also, the callEntityDeathEvent method inside CraftEventFactory has some logic for playing death sounds. I think you need to set the silentDeath field on LivingEntity to true before calling the event for EnderDragon so it doesn't play the death sound by default (which would be a behavior change).
There was a problem hiding this comment.
Will fix this in a few hours. I passed in the drops as a convention (the same is done for armor stand, but I suppose that has drops) - surely it is always empty for the dragon?
Will change the silentDeath field also.
There was a problem hiding this comment.
Yeah, as far as I can tell it is always going to be empty there, but we should just pass an empty list regardless, so its clear its always empty. If you pass the drops list, it might look like its supposed to have drops.
EDIT: As I'm typing this, I'm realizing that datapacks might be able to change the loot table of the dragon so it does have drops, but it looks like the kill command bypasses those in vanilla anyways. So my point still stands.
|
how can we get this blessed by the merge gods? |
|
I can look at it later today specifically in regards to MMs comment on drops👍 |
|
Well, the merge gods cannot give a blessing to a PR that has not addressed the issues outlined 👍 |
|
Apologies, have been very busy. Might get to look at it today! |
|
No worries! Take your time :) My comments were just for cunhar 😅 |
|
Superseded by #9495 |
Fixes #8836.