Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
EntityInteractEvent.java
1 package org.bukkit.event.entity;
2 
3 import org.bukkit.block.Block;
4 import org.bukkit.entity.Entity;
7 
8 /**
9  * Called when an entity interacts with an object
10  */
11 public class EntityInteractEvent extends EntityEvent implements Cancellable {
12  private static final HandlerList handlers = new HandlerList();
13  protected Block block;
14  private boolean cancelled;
15 
16  public EntityInteractEvent(final Entity entity, final Block block) {
17  super(entity);
18  this.block = block;
19  }
20 
21  public boolean isCancelled() {
22  return cancelled;
23  }
24 
25  public void setCancelled(boolean cancel) {
26  cancelled = cancel;
27  }
28 
29  /**
30  * Returns the involved block
31  *
32  * @return the block clicked with this item.
33  */
34  public Block getBlock() {
35  return block;
36  }
37 
38  @Override
39  public HandlerList getHandlers() {
40  return handlers;
41  }
42 
43  public static HandlerList getHandlerList() {
44  return handlers;
45  }
46 }