Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
EntityDamageByBlockEvent.java
1 package org.bukkit.event.entity;
2 
3 import org.bukkit.block.Block;
4 import org.bukkit.entity.Entity;
5 
6 /**
7  * Called when an entity is damaged by a block
8  */
10  private final Block damager;
11 
12  @Deprecated
13  public EntityDamageByBlockEvent(final Block damager, final Entity damagee, final DamageCause cause, final int damage) {
14  this(damager, damagee, cause, (double) damage);
15  }
16 
17  public EntityDamageByBlockEvent(final Block damager, final Entity damagee, final DamageCause cause, final double damage) {
18  super(damagee, cause, damage);
19  this.damager = damager;
20  }
21 
22  /**
23  * Returns the block that damaged the player.
24  *
25  * @return Block that damaged the player
26  */
27  public Block getDamager() {
28  return damager;
29  }
30 }