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 0d407f06866571f3d87891e1a22d7aef625b39db..03ac6ae291945a31552956fc107a3854227e1151 100644 --- a/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -1085,6 +1085,11 @@ public class CraftEventFactory { } else if (source.is(DamageTypes.SONIC_BOOM)) { cause = DamageCause.SONIC_BOOM; } + // Paper start - fix falling block handling + else if (source.is(DamageTypes.FALLING_STALACTITE) || source.is(DamageTypes.FALLING_BLOCK) || source.is(DamageTypes.FALLING_ANVIL)) { + cause = DamageCause.FALLING_BLOCK; + } + // Paper end - fix falling block handling 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)) {