From 04928c58a43e611ba644c8e0e6548b5e22ec72b4 Mon Sep 17 00:00:00 2001 From: Lulu13022002 <41980282+Lulu13022002@users.noreply.github.com> Date: Mon, 12 Jun 2023 19:03:51 +0200 Subject: [PATCH] Fix EntityDeathEvent cancellation (#9323) --- patches/server/Improve-death-events.patch | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/patches/server/Improve-death-events.patch b/patches/server/Improve-death-events.patch index 1745307dd3..d7af0791d2 100644 --- a/patches/server/Improve-death-events.patch +++ b/patches/server/Improve-death-events.patch @@ -137,12 +137,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + this.clearedEquipmentSlots.clear(); + } + // Paper end -+ + +- if (entity == null || entity.killedEntity(worldserver, this)) { + if (this.isSleeping()) { + this.stopSleeping(); + } - -- if (entity == null || entity.killedEntity(worldserver, this)) { ++ + if (!this.level().isClientSide && this.hasCustomName()) { + if (org.spigotmc.SpigotConfig.logNamedDeaths) LivingEntity.LOGGER.info("Named entity {} died: {}", this, this.getCombatTracker().getDeathMessage().getString()); // Spigot + } @@ -154,6 +154,9 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 this.gameEvent(GameEvent.ENTITY_DIE); - this.dropAllDeathLoot(damageSource); - this.createWitherRose(entityliving); ++ } else { ++ this.dead = false; ++ this.setHealth((float) deathEvent.getReviveHealth()); } - this.level().broadcastEntityEvent(this, (byte) 3);