Class EntityLandEvent

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

@NullMarked public class EntityLandEvent extends EntityEvent implements Cancellable
Called when an Entity lands on the block after falling. This event is called before EntityDamageEvent, EntityChangeBlockEvent, PlayerInteractEvent and EntityInteractEvent.
  • Constructor Details

    • EntityLandEvent

      @Internal public EntityLandEvent(Entity entity, Block block, double fallDistance)
  • Method Details

    • getHandlers

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

      public static HandlerList getHandlerList()
    • getBlock

      public Block getBlock()
      Returns the block that the entity landed on.
      Returns:
      the block that the entity landed on
    • 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)
      Sets whether to cancel the landing, cancelling this event will prevent the entity from taking fall damage and interact with the block. (ex: break turtle egg)
      Specified by:
      setCancelled in interface Cancellable
      Parameters:
      cancel - true if the event should be cancelled, false otherwise
    • getFallDistance

      public double getFallDistance()
      Gets the fall distance of the entity before landing.
      Returns:
      the fall distance
    • setFallDistance

      public void setFallDistance(@NonNegative double fallDistance)
      Sets the fall distance of the entity before landing. Fall distance in the event is used to calculate fall damage and the chance of transforming Material.FARMLAND to Material.DIRT and the type of falling sound when the entity lands on Material.POWDER_SNOW.
      Parameters:
      fallDistance - the fall distance
      Throws:
      IllegalArgumentException - if the fall distance is negative or not finite