Class EntityPortalEnterEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
org.bukkit.event.entity.EntityPortalEnterEvent
All Implemented Interfaces:
Cancellable

public class EntityPortalEnterEvent extends EntityEvent implements Cancellable
Called when an entity comes into contact with a portal

Cancelling this event prevents any further processing of the portal for that tick.

See Also:
  • Constructor Details

    • EntityPortalEnterEvent

      @Internal @Deprecated(since="1.21") public EntityPortalEnterEvent(@NotNull @NotNull Entity entity, @NotNull @NotNull Location location)
      Deprecated.
    • EntityPortalEnterEvent

      @Internal public EntityPortalEnterEvent(@NotNull @NotNull Entity entity, @NotNull @NotNull Location location, @NotNull @NotNull PortalType portalType)
  • Method Details

    • getLocation

      @NotNull public @NotNull Location getLocation()
      Gets the portal block the entity is touching
      Returns:
      The portal block the entity is touching
    • getPortalType

      public @NotNull PortalType getPortalType()
      Get the portal type.
      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()