Class HangingPlaceEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.hanging.HangingEvent
org.bukkit.event.hanging.HangingPlaceEvent
- All Implemented Interfaces:
Cancellable
Triggered when a hanging entity is created in the world
-
Nested Class Summary
Nested classes/interfaces inherited from class Event
Event.Result -
Field Summary
Fields inherited from class HangingEvent
hanging -
Constructor Summary
ConstructorsConstructorDescriptionHangingPlaceEvent(@NotNull Hanging hanging, @Nullable Player player, @NotNull Block block, @NotNull BlockFace blockFace, @Nullable EquipmentSlot hand) Deprecated.HangingPlaceEvent(@NotNull Hanging hanging, @Nullable Player player, @NotNull Block block, @NotNull BlockFace blockFace, @Nullable EquipmentSlot hand, @Nullable ItemStack itemStack) -
Method Summary
Modifier and TypeMethodDescriptiongetBlock()Returns the block that the hanging entity was placed onReturns the face of the block that the hanging entity was placed ongetHand()Returns the hand that was used to place the hanging entity, ornullif a player did not place the hanging entity.static @NotNull HandlerListGets the item from which the hanging entity originatedReturns the player placing the hanging entitybooleanGets the cancellation state of this event.voidsetCancelled(boolean cancel) Sets the cancellation state of this event.Methods inherited from class HangingEvent
getEntityMethods inherited from class Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
HangingPlaceEvent
-
HangingPlaceEvent
-
-
Method Details
-
getPlayer
-
getBlock
-
getBlockFace
-
getHand
Returns the hand that was used to place the hanging entity, ornullif a player did not place the hanging entity.- Returns:
- the hand
-
getItemStack
-
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
-