Package org.bukkit.event.entity
Class EntityUnleashEvent
java.lang.Object
org.bukkit.event.Event
org.bukkit.event.entity.EntityEvent
org.bukkit.event.entity.EntityUnleashEvent
- All Implemented Interfaces:
Cancellable
- Direct Known Subclasses:
PlayerUnleashEntityEvent
Called immediately prior to an entity being unleashed.
Cancelling this event when either:
- the leashed entity dies,
- the entity changes dimension, or
- the client has disconnected the leash
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result
-
Field Summary
Fields inherited from class org.bukkit.event.entity.EntityEvent
entity
-
Constructor Summary
ConstructorDescriptionEntityUnleashEvent
(@NotNull Entity entity, @NotNull EntityUnleashEvent.UnleashReason reason) Deprecated.EntityUnleashEvent
(@NotNull Entity entity, @NotNull EntityUnleashEvent.UnleashReason reason, boolean dropLeash) -
Method Summary
Modifier and TypeMethodDescriptionstatic @NotNull HandlerList
Returns the reason for the unleashing.boolean
Gets the cancellation state of this event.boolean
Returns whether a leash item will be dropped.void
setCancelled
(boolean cancel) Sets the cancellation state of this event.void
setDropLeash
(boolean dropLeash) Sets whether a leash item should be dropped.Methods inherited from class org.bukkit.event.entity.EntityEvent
getEntity, getEntityType
Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
EntityUnleashEvent
@Deprecated public EntityUnleashEvent(@NotNull @NotNull Entity entity, @NotNull @NotNull EntityUnleashEvent.UnleashReason reason) Deprecated. -
EntityUnleashEvent
-
-
Method Details
-
getReason
Returns the reason for the unleashing.- Returns:
- The reason
-
isDropLeash
public boolean isDropLeash()Returns whether a leash item will be dropped.- Returns:
- Whether the leash item will be dropped
-
setDropLeash
public void setDropLeash(boolean dropLeash) Sets whether a leash item should be dropped.- Parameters:
dropLeash
- Whether the leash item should be dropped
-
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 interfaceCancellable
- Returns:
- true if this event is cancelled
-
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 interfaceCancellable
- Parameters:
cancel
- true if you wish to cancel this event
-
getHandlers
- Specified by:
getHandlers
in classEvent
-
getHandlerList
-