Class EntityConstructEvent

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

@NullMarked public class EntityConstructEvent extends EntityEvent implements Cancellable
Called just before an Entity spawns due to a pattern of blocks being constructed (golems, the wither, etc.)

Note: This event is fired before EntitySpawnEvent, before the entity is added to the world, the success of this event does not guarantee the entity will actually spawn.

Since:
26.2
  • Constructor Details

    • EntityConstructEvent

      @Internal public EntityConstructEvent(Entity entity, List<Block> blocks)
  • Method Details

    • getBlocks

      public @Unmodifiable List<Block> getBlocks()
      Get an immutable list of the blocks required for this construction, including any required air blocks.
      Returns:
      the blocks
      Since:
      26.2
    • 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
      Since:
      26.2
    • 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
      Since:
      26.2
    • getHandlers

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

      public static HandlerList getHandlerList()
      Since:
      26.2