Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
EntityTameEvent.java
1 package org.bukkit.event.entity;
2 
7 
8 /**
9  * Thrown when a LivingEntity is tamed
10  */
11 public class EntityTameEvent extends EntityEvent implements Cancellable {
12  private static final HandlerList handlers = new HandlerList();
13  private boolean cancelled;
14  private final AnimalTamer owner;
15 
16  public EntityTameEvent(final LivingEntity entity, final AnimalTamer owner) {
17  super(entity);
18  this.owner = owner;
19  }
20 
21  @Override
22  public LivingEntity getEntity() {
23  return (LivingEntity) entity;
24  }
25 
26  public boolean isCancelled() {
27  return cancelled;
28  }
29 
30  public void setCancelled(boolean cancel) {
31  cancelled = cancel;
32  }
33 
34  /**
35  * Gets the owning AnimalTamer
36  *
37  * @return the owning AnimalTamer
38  */
39  public AnimalTamer getOwner() {
40  return owner;
41  }
42 
43  @Override
44  public HandlerList getHandlers() {
45  return handlers;
46  }
47 
48  public static HandlerList getHandlerList() {
49  return handlers;
50  }
51 }