mirror of https://github.com/PaperMC/Paper.git
34 lines
932 B
Java
34 lines
932 B
Java
package com.destroystokyo.paper.event.entity;
|
|
|
|
import org.bukkit.Location;
|
|
import org.bukkit.entity.Entity;
|
|
import org.bukkit.entity.EntityType;
|
|
import org.bukkit.event.entity.CreatureSpawnEvent;
|
|
import org.jetbrains.annotations.ApiStatus;
|
|
import org.jetbrains.annotations.NotNull;
|
|
import org.jetbrains.annotations.Nullable;
|
|
|
|
|
|
/**
|
|
* Called when a phantom is spawned for an exhausted player
|
|
*/
|
|
public class PhantomPreSpawnEvent extends PreCreatureSpawnEvent {
|
|
@NotNull private final Entity entity;
|
|
|
|
@ApiStatus.Internal
|
|
public PhantomPreSpawnEvent(@NotNull Location location, @NotNull Entity entity, @NotNull CreatureSpawnEvent.SpawnReason reason) {
|
|
super(location, EntityType.PHANTOM, reason);
|
|
this.entity = entity;
|
|
}
|
|
|
|
/**
|
|
* Get the entity this phantom is spawning for
|
|
*
|
|
* @return Entity
|
|
*/
|
|
@NotNull
|
|
public Entity getSpawningEntity() {
|
|
return entity;
|
|
}
|
|
}
|