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.

  • Constructor Details

  • 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
    • 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
    • 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
    • getHandlers

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

      public static HandlerList getHandlerList()