summaryrefslogtreecommitdiffstats
path: root/src/main/java/org/bukkit/event/entity/EntityDamageByBlockEvent.java
blob: 1154afc92992657640a559b5499d552a672eb90b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package org.bukkit.event.entity;

import org.bukkit.block.Block;
import org.bukkit.entity.Entity;
import org.bukkit.event.Cancellable;
import org.bukkit.event.Event;

/**
 * Stores details for damage events where the damager is a block
 */
public class EntityDamageByBlockEvent extends EntityDamageEvent implements Cancellable {

    private Block damager;

    public EntityDamageByBlockEvent(Block damager, Entity damagee, DamageCause cause, int damage)
    {
        super(Event.Type.ENTITY_DAMAGE, damagee, cause, damage);
        this.damager = damager;
    }

    /**
     * Returns the block that damaged the player.
     * @return Block that damaged the player
     */
    public Block getDamager()
    {
        return damager;
    }

}