Cancellable
PhantomPreSpawnEvent
, PreSpawnerSpawnEvent
public class PreCreatureSpawnEvent extends Event implements Cancellable
Event.Result
Constructor | Description |
---|---|
PreCreatureSpawnEvent(@NotNull Location location,
@NotNull EntityType type,
CreatureSpawnEvent.SpawnReason reason) |
Modifier and Type | Method | Description |
---|---|---|
static @NotNull HandlerList |
getHandlerList() |
|
@NotNull HandlerList |
getHandlers() |
|
CreatureSpawnEvent.SpawnReason |
getReason() |
|
@NotNull Location |
getSpawnLocation() |
|
@NotNull EntityType |
getType() |
|
boolean |
isCancelled() |
Gets the cancellation state of this event.
|
void |
setCancelled(boolean cancel) |
Cancelling this event is more effecient than cancelling CreatureSpawnEvent
|
void |
setShouldAbortSpawn(boolean shouldAbortSpawn) |
Set this if you are more blanket blocking all types of these spawns, and wish to abort the spawn process from
trying more attempts after this cancellation.
|
boolean |
shouldAbortSpawn() |
callEvent, getEventName, isAsynchronous
public PreCreatureSpawnEvent(@NotNull @NotNull Location location, @NotNull @NotNull EntityType type, @NotNull CreatureSpawnEvent.SpawnReason reason)
@NotNull public @NotNull Location getSpawnLocation()
@NotNull public @NotNull EntityType getType()
@NotNull public CreatureSpawnEvent.SpawnReason getReason()
public boolean shouldAbortSpawn()
public void setShouldAbortSpawn(boolean shouldAbortSpawn)
shouldAbortSpawn
- Set if the spawn process should be aborted vs trying more attempts@NotNull public @NotNull HandlerList getHandlers()
getHandlers
in class Event
@NotNull public static @NotNull HandlerList getHandlerList()
public boolean isCancelled()
Cancellable
isCancelled
in interface Cancellable
public void setCancelled(boolean cancel)
setCancelled
in interface Cancellable
cancel
- true if you wish to cancel this event, and abort the spawn of this creatureCopyright © 2020. All rights reserved.