Class EntityPortalReadyEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
io.papermc.paper.event.entity.EntityPortalReadyEvent
All Implemented Interfaces:
Cancellable

@NullMarked 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.

  • Constructor Details

  • Method Details

    • getTargetWorld

      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 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

      public 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

      public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      public static HandlerList getHandlerList()