Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
SlimeSplitEvent.java
1 package org.bukkit.event.entity;
2 
3 import org.bukkit.entity.Slime;
6 
7 /**
8  * Called when a Slime splits into smaller Slimes upon death
9  */
10 public class SlimeSplitEvent extends EntityEvent implements Cancellable {
11  private static final HandlerList handlers = new HandlerList();
12  private boolean cancel = false;
13  private int count;
14 
15  public SlimeSplitEvent(final Slime slime, final int count) {
16  super(slime);
17  this.count = count;
18  }
19 
20  public boolean isCancelled() {
21  return cancel;
22  }
23 
24  public void setCancelled(boolean cancel) {
25  this.cancel = cancel;
26  }
27 
28  @Override
29  public Slime getEntity() {
30  return (Slime) entity;
31  }
32 
33  /**
34  * Gets the amount of smaller slimes to spawn
35  *
36  * @return the amount of slimes to spawn
37  */
38  public int getCount() {
39  return count;
40  }
41 
42  /**
43  * Sets how many smaller slimes will spawn on the split
44  *
45  * @param count the amount of slimes to spawn
46  */
47  public void setCount(int count) {
48  this.count = count;
49  }
50 
51  @Override
52  public HandlerList getHandlers() {
53  return handlers;
54  }
55 
56  public static HandlerList getHandlerList() {
57  return handlers;
58  }
59 }