--- a/net/minecraft/world/item/enchantment/effects/ExplodeEffect.java
+++ b/net/minecraft/world/item/enchantment/effects/ExplodeEffect.java
@@ -40,7 +40,7 @@
 
     @Nullable
     private DamageSource getDamageSource(Entity entity, Vec3D vec3d) {
-        return this.damageType.isEmpty() ? null : (this.attributeToUser ? new DamageSource((Holder) this.damageType.get(), entity) : new DamageSource((Holder) this.damageType.get(), vec3d));
+        return this.damageType.isEmpty() ? (entity == null ? null : entity.level().damageSources().explosion(null).customCausingEntityDamager(entity)) : (this.attributeToUser ? new DamageSource((Holder) this.damageType.get(), entity) : new DamageSource((Holder) this.damageType.get(), vec3d)); // CraftBukkit - copy from explosion default damagesource to allow tracking entity behind the effect
     }
 
     @Override
