Package org.purpurmc.purpur.event.entity
Class EntityTeleportHinderedEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
org.purpurmc.purpur.event.entity.EntityTeleportHinderedEvent
Fired when an entity is hindered from teleporting.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumReason for hindrance in teleports.Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Field Summary
Fields inherited from class org.bukkit.event.entity.EntityEvent
entity -
Constructor Summary
ConstructorsConstructorDescriptionEntityTeleportHinderedEvent(@NotNull Entity what, @NotNull EntityTeleportHinderedEvent.Reason reason, @Nullable PlayerTeleportEvent.TeleportCause teleportCause) -
Method Summary
Modifier and TypeMethodDescriptionbooleanCalls the event and tests if should retry.static @NotNull HandlerListvoidsetShouldRetry(boolean retry) Sets whether the teleport should be retried.booleanWhether the teleport should be retried.Methods inherited from class org.bukkit.event.entity.EntityEvent
getEntity, getEntityTypeMethods inherited from class org.bukkit.event.Event
asynchronous, getEventName, isAsynchronous
-
Constructor Details
-
EntityTeleportHinderedEvent
public EntityTeleportHinderedEvent(@NotNull @NotNull Entity what, @NotNull @NotNull EntityTeleportHinderedEvent.Reason reason, @Nullable @Nullable PlayerTeleportEvent.TeleportCause teleportCause)
-
-
Method Details
-
getReason
- Returns:
- why the teleport was hindered.
-
getTeleportCause
- Returns:
- why the teleport occurred if cause was given, otherwise
null.
-
shouldRetry
public boolean shouldRetry()Whether the teleport should be retried.Note that this can put the server in a never-ending loop of trying to teleport someone resulting in a stack overflow. Do not retry more than necessary.
- Returns:
- whether the teleport should be retried.
-
setShouldRetry
public void setShouldRetry(boolean retry) Sets whether the teleport should be retried.Note that this can put the server in a never-ending loop of trying to teleport someone resulting in a stack overflow. Do not retry more than necessary.
- Parameters:
retry- whether the teleport should be retried.
-
callEvent
public boolean callEvent()Calls the event and tests if should retry. -
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-