Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
EntityUnleashEvent.java
1 package org.bukkit.event.entity;
2 
3 import org.bukkit.entity.Entity;
5 
6 /**
7  * Called immediately prior to an entity being unleashed.
8  */
9 public class EntityUnleashEvent extends EntityEvent {
10  private static final HandlerList handlers = new HandlerList();
11  private final UnleashReason reason;
12 
13  public EntityUnleashEvent(Entity entity, UnleashReason reason) {
14  super(entity);
15  this.reason = reason;
16  }
17 
18  /**
19  * Returns the reason for the unleashing.
20  *
21  * @return The reason
22  */
24  return reason;
25  }
26 
27  @Override
28  public HandlerList getHandlers() {
29  return handlers;
30  }
31 
32  public static HandlerList getHandlerList() {
33  return handlers;
34  }
35 
36  public enum UnleashReason {
37  /**
38  * When the entity's leashholder has died or logged out, and so is
39  * unleashed
40  */
42  /**
43  * When the entity's leashholder attempts to unleash it
44  */
46  /**
47  * When the entity's leashholder is more than 10 blocks away
48  */
50  UNKNOWN;
51  }
52 }