Fork of Poseidon providing Bukkit #1060 to older Beta versions (b1.0-b1.7.3)
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 is damaged by a block
9 */
10public class EntityDamageByBlockEvent extends EntityDamageEvent implements Cancellable {
11
12 private Block damager;
13
14 public EntityDamageByBlockEvent(Block damager, Entity damagee, DamageCause cause, int damage) {
15 super(Type.ENTITY_DAMAGE, damagee, cause, damage);
16 this.damager = damager;
17 }
18
19 /**
20 * Returns the block that damaged the player.
21 *
22 * @return Block that damaged the player
23 */
24 public Block getDamager() {
25 return damager;
26 }
27}