Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
at develop 36 lines 789 B view raw
1package org.bukkit.event.entity; 2 3import org.bukkit.block.Block; 4import org.bukkit.entity.Entity; 5import org.bukkit.event.Cancellable; 6 7/** 8 * Called when an entity interacts with an object 9 */ 10public class EntityInteractEvent extends EntityEvent implements Cancellable { 11 protected Block block; 12 13 private boolean cancelled; 14 15 public EntityInteractEvent(Entity entity, Block block) { 16 super(Type.ENTITY_INTERACT, entity); 17 this.block = block; 18 } 19 20 public boolean isCancelled() { 21 return cancelled; 22 } 23 24 public void setCancelled(boolean cancel) { 25 cancelled = cancel; 26 } 27 28 /** 29 * Returns the involved block 30 * 31 * @return the block clicked with this item. 32 */ 33 public Block getBlock() { 34 return block; 35 } 36}