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
- Since:
- 1.1.0
-
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.@NotNull EntityGets the entity the player is shearing@NotNull EquipmentSlotgetHand()Gets the hand used to shear the entity.static @NotNull HandlerList@NotNull HandlerList@NotNull ItemStackgetItem()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
Gets the entity the player is shearing- Returns:
- the entity the player is shearing
- Since:
- 1.1.0
-
getItem
Gets the item used to shear the entity.- Returns:
- the shears
- Since:
- 1.15.2
-
getHand
Gets the hand used to shear the entity.- Returns:
- the hand
- Since:
- 1.15.2
-
getDrops
-
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- Since:
- 1.1.0
-
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- Since:
- 1.1.0
-
getHandlers
- Specified by:
getHandlersin classEvent- Since:
- 1.1.0
-
getHandlerList
- Since:
- 1.1.0
-