From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Doc Date: Mon, 1 May 2023 13:34:57 -0400 Subject: [PATCH] Fix DamageCause for Falling Blocks diff --git a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index f8f221705a1fab5dbb20ebd4c972e37d96038e4a..8b923b85723f0c7c4035caf8bcf995062535b8e8 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1036,6 +1036,11 @@ public class CraftEventFactory { } else if (source.is(DamageTypes.SONIC_BOOM)) { cause = DamageCause.SONIC_BOOM; } + // Paper start - fix handle of Falling Blocks + else if (source.is(DamageTypes.FALLING_STALACTITE) || source.is(DamageTypes.FALLING_BLOCK) || source.is(DamageTypes.FALLING_ANVIL)) { + cause = DamageCause.FALLING_BLOCK; + } + // Paper end return CraftEventFactory.callEntityDamageEvent(damager, entity, cause, modifiers, modifierFunctions, cancelled, source.isCritical()); // Paper - add critical damage API } else if (source.is(DamageTypes.FELL_OUT_OF_WORLD)) {