From 9fe671127a161680d6341388391a0d895393e567 Mon Sep 17 00:00:00 2001 From: Golfing8 Date: Mon, 8 May 2023 09:18:17 -0400 Subject: [PATCH] ExperienceOrb should call EntitySpawnEvent --- .../java/org/bukkit/craftbukkit/event/CraftEventFactory.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java index 28e56095ec..b1ce440bc5 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/event/CraftEventFactory.java @@ -744,7 +744,8 @@ public class CraftEventFactory { // Spigot start - SPIGOT-7523: Merge after spawn event and only merge if the event was not cancelled (gets checked above) if (entity instanceof net.minecraft.world.entity.ExperienceOrb xp) { double radius = world.spigotConfig.expMerge; - if (radius > 0) { + event = CraftEventFactory.callEntitySpawnEvent(entity); // Call spawn event for ExperienceOrb entities + if (radius > 0 && !event.isCancelled() && !entity.isRemoved()) { // Paper start - Maximum exp value when merging; Whole section has been tweaked, see comments for specifics final long maxValue = world.paperConfig().entities.behavior.experienceMergeMaxValue; final boolean mergeUnconditionally = maxValue <= 0;