Class CustomEntitySpawnEvent
java.lang.Object
org.bukkit.event.Event
com.github.darksoulq.abyssallib.server.event.custom.entity.CustomEntitySpawnEvent
- All Implemented Interfaces:
org.bukkit.event.Cancellable
public class CustomEntitySpawnEvent
extends org.bukkit.event.Event
implements org.bukkit.event.Cancellable
Custom event triggered when a custom
CustomEntity is spawned into the world.
This event is cancellable, allowing control over whether the spawn should proceed.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe reason why a custom entity is being spawned.Nested classes/interfaces inherited from class org.bukkit.event.Event
org.bukkit.event.Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionCustomEntitySpawnEvent(@NotNull CustomEntity<? extends org.bukkit.entity.LivingEntity> entity, @NotNull CustomEntitySpawnEvent.SpawnReason reason) Constructs a newEntitySpawnEvent. -
Method Summary
Modifier and TypeMethodDescription@NotNull CustomEntity<? extends org.bukkit.entity.LivingEntity> Gets the custom entity being spawned.static org.bukkit.event.HandlerList@NotNull org.bukkit.event.HandlerListGets the list of handlers for this event.@NotNull CustomEntitySpawnEvent.SpawnReasonGets the reason for this entity's spawn.booleanChecks whether the event is cancelled.voidsetCancelled(boolean v) Sets the cancellation state of the event.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
CustomEntitySpawnEvent
public CustomEntitySpawnEvent(@NotNull @NotNull CustomEntity<? extends org.bukkit.entity.LivingEntity> entity, @NotNull @NotNull CustomEntitySpawnEvent.SpawnReason reason) Constructs a newEntitySpawnEvent.- Parameters:
entity- The custom entity being spawned.reason- The reason for the entity's spawn.
-
-
Method Details
-
getEntity
Gets the custom entity being spawned.- Returns:
- The entity being spawned.
-
getReason
Gets the reason for this entity's spawn.- Returns:
- The spawn reason.
-
isCancelled
public boolean isCancelled()Checks whether the event is cancelled.- Specified by:
isCancelledin interfaceorg.bukkit.event.Cancellable- Returns:
trueif the event is cancelled,falseotherwise.
-
setCancelled
public void setCancelled(boolean v) Sets the cancellation state of the event.- Specified by:
setCancelledin interfaceorg.bukkit.event.Cancellable- Parameters:
v-trueto cancel the event,falseto allow it.
-
getHandlers
@NotNull public @NotNull org.bukkit.event.HandlerList getHandlers()Gets the list of handlers for this event.- Specified by:
getHandlersin classorg.bukkit.event.Event- Returns:
- The handler list.
-
getHandlerList
public static org.bukkit.event.HandlerList getHandlerList()
-