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`

public class EntityPortalReadyEvent extends EntityEvent implements 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

Constructors
Constructor
Description
`EntityPortalReadyEvent(@NotNull Entity entity, @Nullable World targetWorld, @NotNull PortalType portalType)`

## Method Summary

Modifier and Type
Method
Description
`static @NotNull HandlerList`
`getHandlerList()`
`@NotNull HandlerList`
`getHandlers()`
`@NotNull PortalType`
`getPortalType()`
Gets the portal type for this event.
`@Nullable World`
`getTargetWorld()`
Gets the world this portal will teleport to.
`boolean`
`isCancelled()`
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`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### EntityPortalReadyEvent

public EntityPortalReadyEvent(@NotNull @NotNull Entity entity, @Nullable @Nullable World targetWorld, @NotNull @NotNull PortalType portalType)

## Method Details

### getTargetWorld

@Nullable public @Nullable World 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` or `EntityPortalEvent`.

Returns:
  the world the portal will teleport the entity to.

### setTargetWorld

public void setTargetWorld(@Nullable @Nullable World targetWorld)
Sets the world this portal will teleport to. A null value will essentially cancel the teleport and prevent further events such as `PlayerPortalEvent` from firing.

This world may be modified by later events such as `PlayerPortalEvent` or `EntityPortalEvent`.

Parameters:
  `targetWorld` - the world

### getPortalType

@NotNull public @NotNull PortalType 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 interface `Cancellable`
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 interface `Cancellable`
Parameters:
  `cancel` - true if you wish to cancel this event

### getHandlers

@NotNull public @NotNull HandlerList getHandlers()

Specified by:
  `getHandlers` in class `Event`

### getHandlerList

@NotNull public static @NotNull HandlerList getHandlerList()