Bukkit  1.5.2-R1.0
 All Classes Namespaces Files Functions Variables Enumerator Pages
EntityDamageEvent.java
Go to the documentation of this file.
1 package org.bukkit.event.entity;
2 
3 import org.bukkit.entity.Entity;
4 import org.bukkit.event.Cancellable;
5 import org.bukkit.event.HandlerList;
6 
10 public class EntityDamageEvent extends EntityEvent implements Cancellable {
11  private static final HandlerList handlers = new HandlerList();
12  private int damage;
13  private boolean cancelled;
14  private final DamageCause cause;
15 
16  public EntityDamageEvent(final Entity damagee, final DamageCause cause, final int damage) {
17  super(damagee);
18  this.cause = cause;
19  this.damage = damage;
20  }
21 
22  public boolean isCancelled() {
23  return cancelled;
24  }
25 
26  public void setCancelled(boolean cancel) {
27  cancelled = cancel;
28  }
29 
35  public int getDamage() {
36  return damage;
37  }
38 
44  public void setDamage(int damage) {
45  this.damage = damage;
46  }
47 
53  public DamageCause getCause() {
54  return cause;
55  }
56 
57  @Override
59  return handlers;
60  }
61 
62  public static HandlerList getHandlerList() {
63  return handlers;
64  }
65 
69  public enum DamageCause {
70 
202  CUSTOM
203  }
204 }