From 4e0abeaedb4a465b72f1dbc31205d53bb9980a5f Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Sat, 10 Jun 2023 07:22:34 +1000 Subject: [PATCH] Define SpawnerSpawnEvent By: Andy Shulman --- .../event/entity/SpawnerSpawnEvent.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 paper-api/src/main/java/org/bukkit/event/entity/SpawnerSpawnEvent.java diff --git a/paper-api/src/main/java/org/bukkit/event/entity/SpawnerSpawnEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/SpawnerSpawnEvent.java new file mode 100644 index 0000000000..9353f0d092 --- /dev/null +++ b/paper-api/src/main/java/org/bukkit/event/entity/SpawnerSpawnEvent.java @@ -0,0 +1,24 @@ +package org.bukkit.event.entity; + +import org.bukkit.block.CreatureSpawner; +import org.bukkit.entity.Entity; +import org.jetbrains.annotations.NotNull; + +/** + * Called when an entity is spawned into a world by a spawner. + *

+ * If a Spawner Spawn event is cancelled, the entity will not spawn. + */ +public class SpawnerSpawnEvent extends EntitySpawnEvent { + private final CreatureSpawner spawner; + + public SpawnerSpawnEvent(@NotNull final Entity spawnee, @NotNull final CreatureSpawner spawner) { + super(spawnee); + this.spawner = spawner; + } + + @NotNull + public CreatureSpawner getSpawner() { + return spawner; + } +}