Package io.papermc.paper.event.entity
Class EntityPortalReadyEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
io.papermc.paper.event.entity.EntityPortalReadyEvent
- All Implemented Interfaces:
Cancellable
Called when an entity is ready to be teleported by a plugin.
Currently this is only called after the required
ticks have passed for a Nether Portal.
Cancelling this event resets the entity's readiness regarding the current portal.
-
Nested Class Summary
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
ConstructorsConstructorDescriptionEntityPortalReadyEvent(@NotNull Entity entity, @Nullable World targetWorld, @NotNull PortalType portalType) -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull HandlerListGets the portal type for this event.Gets the world this portal will teleport to.booleanGets the cancellation state of this event.voidsetCancelled(boolean cancel) Sets the cancellation state of this event.voidsetTargetWorld(@Nullable World targetWorld) Sets the world this portal will teleport to.Methods inherited from class org.bukkit.event.entity.EntityEvent
getEntity, getEntityTypeMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
EntityPortalReadyEvent
-
-
Method Details
-
getTargetWorld
Gets the world this portal will teleport to. Can be null if "allow-nether" is false in server.properties or if there is another situation where there is no world to teleport to.This world may be modified by later events such as
PlayerPortalEventorEntityPortalEvent.- Returns:
- the world the portal will teleport the entity to.
-
setTargetWorld
Sets the world this portal will teleport to. A null value will essentially cancel the teleport and prevent further events such asPlayerPortalEventfrom firing.This world may be modified by later events such as
PlayerPortalEventorEntityPortalEvent.- Parameters:
targetWorld- the world
-
getPortalType
Gets the portal type for this event.- Returns:
- the portal type
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableGets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins- Specified by:
isCancelledin interfaceCancellable- Returns:
- true if this event is cancelled
-
setCancelled
public void setCancelled(boolean cancel) Description copied from interface:CancellableSets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.- Specified by:
setCancelledin interfaceCancellable- Parameters:
cancel- true if you wish to cancel this event
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-