From 5c5214c45c317c78de134695e87e27c544e64014 Mon Sep 17 00:00:00 2001 From: Alex 'mcmonkey' Goodwin Date: Sun, 27 Dec 2020 15:54:14 -0800 Subject: [PATCH] possible fix for spawner spawn event dup --- .../denizen/events/entity/EntitySpawnScriptEvent.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntitySpawnScriptEvent.java b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntitySpawnScriptEvent.java index fef884db10..6a8995ac65 100644 --- a/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntitySpawnScriptEvent.java +++ b/plugin/src/main/java/com/denizenscript/denizen/events/entity/EntitySpawnScriptEvent.java @@ -115,7 +115,11 @@ public void onEntitySpawn(EntitySpawnEvent event) { this.entity = new EntityTag(entity); location = new LocationTag(event.getLocation()); if (event instanceof CreatureSpawnEvent) { - reason = new ElementTag(((CreatureSpawnEvent) event).getSpawnReason().name()); + CreatureSpawnEvent.SpawnReason creatureReason = ((CreatureSpawnEvent) event).getSpawnReason(); + if (creatureReason == CreatureSpawnEvent.SpawnReason.SPAWNER) { + return; // Let the SpawnerSpawnEvent happen and handle it instead + } + reason = new ElementTag(creatureReason.name()); } else if (event instanceof SpawnerSpawnEvent) { reason = new ElementTag("SPAWNER");