Class EntityPortalEvent

All Implemented Interfaces:
Cancellable

public class EntityPortalEvent extends EntityTeleportEvent
Called when a non-player entity is about to teleport because it is in contact with a portal.

For players see PlayerPortalEvent

  • Constructor Details

    • EntityPortalEvent

      public EntityPortalEvent(@NotNull Entity entity, @NotNull Location from, @Nullable Location to)
    • EntityPortalEvent

      public EntityPortalEvent(@NotNull Entity entity, @NotNull Location from, @Nullable Location to, int searchRadius)
  • Method Details

    • setSearchRadius

      public void setSearchRadius(int searchRadius)
      Set the Block radius to search in for available portals.
      Parameters:
      searchRadius - the radius in which to search for a portal from the location
    • getSearchRadius

      public int getSearchRadius()
      Gets the search radius value for finding an available portal.
      Returns:
      the currently set search radius
    • getHandlers

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

      @NotNull public static HandlerList getHandlerList()