Class EntityPlaceEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
org.bukkit.event.entity.EntityPlaceEvent
- All Implemented Interfaces:
Cancellable
Triggered when an entity is created in the world by a player "placing" an item
on a block.
Note that this event is currently only fired for four specific placements: armor stands, boats, minecarts, and end crystals.
Note that this event is currently only fired for four specific placements: armor stands, boats, minecarts, and end crystals.
-
Nested Class Summary
Nested classes/interfaces inherited from class Event
Event.Result -
Field Summary
Fields inherited from class EntityEvent
entity -
Constructor Summary
ConstructorsConstructorDescriptionEntityPlaceEvent(@NotNull Entity entity, @Nullable Player player, @NotNull Block block, @NotNull BlockFace blockFace) Deprecated, for removal: This API element is subject to removal in a future version.EntityPlaceEvent(@NotNull Entity entity, @Nullable Player player, @NotNull Block block, @NotNull BlockFace blockFace, @NotNull EquipmentSlot hand) -
Method Summary
Modifier and TypeMethodDescriptiongetBlock()Returns the block that the entity was placed onReturns the face of the block that the entity was placed ongetHand()Get the hand used to place the entity.static @NotNull HandlerListReturns the player placing the entitybooleanGets the cancellation state of this event.voidsetCancelled(boolean cancel) Sets the cancellation state of this event.Methods inherited from class EntityEvent
getEntity, getEntityTypeMethods inherited from class Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
EntityPlaceEvent
-
EntityPlaceEvent
@Internal @Deprecated(since="1.19.2", forRemoval=true) public EntityPlaceEvent(@NotNull @NotNull Entity entity, @Nullable @Nullable Player player, @NotNull @NotNull Block block, @NotNull @NotNull BlockFace blockFace) Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
getPlayer
-
getBlock
-
getBlockFace
-
getHand
Get the hand used to place the entity.- Returns:
- the hand
-
isCancelled
public boolean isCancelled()Description copied from interface:CancellableGets 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:
isCancelledin interfaceCancellable- Returns:
trueif this event is cancelled
-
setCancelled
public void setCancelled(boolean cancel) Description copied from interface:CancellableSets 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:
setCancelledin interfaceCancellable- Parameters:
cancel-trueif you wish to cancel this event
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getHandlerList
-