From 5f87bde00efc18bd6f6e3f7f44e098ff8dcc4790 Mon Sep 17 00:00:00 2001 From: Take Weiland Date: Wed, 24 Nov 2021 02:11:03 +0100 Subject: [PATCH] Fix death message for tamed animals not having proper cause of death. (#8196) --- .../net/minecraft/world/entity/TamableAnimal.java.patch | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/patches/minecraft/net/minecraft/world/entity/TamableAnimal.java.patch b/patches/minecraft/net/minecraft/world/entity/TamableAnimal.java.patch index d90ef5ad2f..9dbafaa6b2 100644 --- a/patches/minecraft/net/minecraft/world/entity/TamableAnimal.java.patch +++ b/patches/minecraft/net/minecraft/world/entity/TamableAnimal.java.patch @@ -1,15 +1,17 @@ --- a/net/minecraft/world/entity/TamableAnimal.java +++ b/net/minecraft/world/entity/TamableAnimal.java -@@ -197,11 +_,14 @@ +@@ -197,11 +_,15 @@ } public void m_6667_(DamageSource p_21809_) { + // FORGE: Super moved to top so that death message would be cancelled properly ++ net.minecraft.network.chat.Component deathMessage = this.m_21231_().m_19293_(); + super.m_6667_(p_21809_); + + if (this.f_20890_) if (!this.f_19853_.f_46443_ && this.f_19853_.m_46469_().m_46207_(GameRules.f_46142_) && this.m_142480_() instanceof ServerPlayer) { - this.m_142480_().m_6352_(this.m_21231_().m_19293_(), Util.f_137441_); +- this.m_142480_().m_6352_(this.m_21231_().m_19293_(), Util.f_137441_); ++ this.m_142480_().m_6352_(deathMessage, Util.f_137441_); } - super.m_6667_(p_21809_);