Class EntityPortalExitEvent

All Implemented Interfaces:
Cancellable

public class EntityPortalExitEvent extends EntityTeleportEvent
Called before an entity exits a portal.

This event allows you to modify the velocity of the entity after they have successfully exited the portal.

  • Constructor Details

    • EntityPortalExitEvent

      public EntityPortalExitEvent(@NotNull Entity entity, @NotNull Location from, @NotNull Location to, @NotNull Vector before, @NotNull Vector after)
  • Method Details

    • getBefore

      @NotNull public Vector getBefore()
      Gets a copy of the velocity that the entity has before entering the portal.
      Returns:
      velocity of entity before entering the portal
    • getAfter

      @NotNull public Vector getAfter()
      Gets a copy of the velocity that the entity will have after exiting the portal.
      Returns:
      velocity of entity after exiting the portal
    • setAfter

      public void setAfter(@NotNull Vector after)
      Sets the velocity that the entity will have after exiting the portal.
      Parameters:
      after - the velocity after exiting the portal
    • getHandlers

      @NotNull public HandlerList getHandlers()
      Overrides:
      getHandlers in class EntityTeleportEvent
    • getHandlerList

      @NotNull public static HandlerList getHandlerList()