From 9683d23812bd317f17e98a7d2cdc17890f1e61d6 Mon Sep 17 00:00:00 2001
From: Bukkit/Spigot <noreply+git-bukkit@papermc.io>
Date: Fri, 28 Jun 2024 07:06:33 +1000
Subject: [PATCH] #1034: Add TrialSpawnerSpawnEvent

By: Doc <nachito94@msn.com>
---
 .../event/entity/TrialSpawnerSpawnEvent.java  | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 paper-api/src/main/java/org/bukkit/event/entity/TrialSpawnerSpawnEvent.java

diff --git a/paper-api/src/main/java/org/bukkit/event/entity/TrialSpawnerSpawnEvent.java b/paper-api/src/main/java/org/bukkit/event/entity/TrialSpawnerSpawnEvent.java
new file mode 100644
index 0000000000..589b06ce0e
--- /dev/null
+++ b/paper-api/src/main/java/org/bukkit/event/entity/TrialSpawnerSpawnEvent.java
@@ -0,0 +1,26 @@
+package org.bukkit.event.entity;
+
+import org.bukkit.block.TrialSpawner;
+import org.bukkit.entity.Entity;
+import org.jetbrains.annotations.ApiStatus;
+import org.jetbrains.annotations.NotNull;
+
+/**
+ * Called when an entity is spawned into a world by a trial spawner.
+ * <p>
+ * If a Trial Spawner Spawn event is cancelled, the entity will not spawn.
+ */
+@ApiStatus.Experimental
+public class TrialSpawnerSpawnEvent extends EntitySpawnEvent {
+    private final TrialSpawner spawner;
+
+    public TrialSpawnerSpawnEvent(@NotNull final Entity spawnee, @NotNull final TrialSpawner spawner) {
+        super(spawnee);
+        this.spawner = spawner;
+    }
+
+    @NotNull
+    public TrialSpawner getTrialSpawner() {
+        return spawner;
+    }
+}