Define SpawnerSpawnEvent

By: Andy Shulman <andy.shulman@hotmail.com>
This commit is contained in:
Bukkit/Spigot 2023-06-10 07:22:34 +10:00
parent 0ce4f87779
commit 4e0abeaedb

View file

@ -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.
* <p>
* 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;
}
}