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
ConstructorDescriptionEntityPortalReadyEvent
(@NotNull Entity entity, @Nullable World targetWorld, @NotNull PortalType portalType) -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull HandlerList
Gets the portal type for this event.Gets the world this portal will teleport to.boolean
Gets the cancellation state of this event.void
setCancelled
(boolean cancel) Sets the cancellation state of this event.void
setTargetWorld
(@Nullable World targetWorld) Sets the world this portal will teleport to.Methods inherited from class org.bukkit.event.entity.EntityEvent
getEntity, getEntityType
Methods 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
PlayerPortalEvent
orEntityPortalEvent
.- 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 asPlayerPortalEvent
from firing.This world may be modified by later events such as
PlayerPortalEvent
orEntityPortalEvent
.- Parameters:
targetWorld
- the world
-
getPortalType
Gets the portal type for this event.- Returns:
- the portal type
-
isCancelled
public boolean isCancelled()Description copied from interface:Cancellable
Gets 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:
isCancelled
in interfaceCancellable
- Returns:
- true if this event is cancelled
-
setCancelled
public void setCancelled(boolean cancel) Description copied from interface:Cancellable
Sets 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:
setCancelled
in interfaceCancellable
- Parameters:
cancel
- true if you wish to cancel this event
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-