mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-28 20:07:41 +01:00
Define SpawnerSpawnEvent
By: Andy Shulman <andy.shulman@hotmail.com>
This commit is contained in:
parent
0ce4f87779
commit
4e0abeaedb
@ -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;
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user