Class PlayerShearEntityEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
org.bukkit.event.player.PlayerShearEntityEvent
- All Implemented Interfaces:
Cancellable
Called when a player shears an entity
-
Nested Class Summary
Nested classes/interfaces inherited from class Event
Event.Result -
Field Summary
Fields inherited from class PlayerEvent
player -
Constructor Summary
ConstructorsConstructorDescriptionPlayerShearEntityEvent(@NotNull Player player, @NotNull Entity entity) Deprecated, for removal: This API element is subject to removal in a future version.PlayerShearEntityEvent(@NotNull Player player, @NotNull Entity entity, @NotNull ItemStack item, @NotNull EquipmentSlot hand, @NotNull List<ItemStack> drops) -
Method Summary
Modifier and TypeMethodDescriptiongetDrops()Get an immutable list of drops for this shearing.Gets the entity the player is shearinggetHand()Gets the hand used to shear the entity.static @NotNull HandlerListgetItem()Gets the item used to shear the entity.booleanGets the cancellation state of this event.voidsetCancelled(boolean cancel) Sets the cancellation state of this event.voidSets the drops for the shearing.Methods inherited from class PlayerEvent
getPlayerMethods inherited from class Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PlayerShearEntityEvent
-
PlayerShearEntityEvent
@Internal @Deprecated(since="1.15.2", forRemoval=true) public PlayerShearEntityEvent(@NotNull @NotNull Player player, @NotNull @NotNull Entity entity) Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
getEntity
-
getItem
-
getHand
Gets the hand used to shear the entity.- Returns:
- the hand
-
getDrops
Get an immutable list of drops for this shearing.- Returns:
- the shearing drops
- See Also:
-
setDrops
-
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
-