Class EntityUnleashEvent

All Implemented Interfaces:
Cancellable
Direct Known Subclasses:
PlayerUnleashEntityEvent

public class EntityUnleashEvent extends EntityEvent implements Cancellable
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
will have no effect.
  • Constructor Details

  • 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 interface Cancellable
      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 interface Cancellable
      Parameters:
      cancel - true if you wish to cancel this event
    • getHandlers

      @NotNull public HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getHandlerList

      @NotNull public static HandlerList getHandlerList()