Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
PlayerUnleashEntityEvent.java
1 package org.bukkit.event.player;
2 
3 import org.bukkit.entity.Entity;
4 import org.bukkit.entity.Player;
7 
8 /**
9  * Called prior to an entity being unleashed due to a player's action.
10  */
11 public class PlayerUnleashEntityEvent extends EntityUnleashEvent implements Cancellable {
12  private final Player player;
13  private boolean cancelled = false;
14 
15  public PlayerUnleashEntityEvent(Entity entity, Player player) {
16  super(entity, UnleashReason.PLAYER_UNLEASH);
17  this.player = player;
18  }
19 
20  /**
21  * Returns the player who is unleashing the entity.
22  *
23  * @return The player
24  */
25  public Player getPlayer() {
26  return player;
27  }
28 
29  public boolean isCancelled() {
30  return cancelled;
31  }
32 
33  public void setCancelled(boolean cancel) {
34  this.cancelled = cancel;
35  }
36 }