Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
PlayerItemBreakEvent.java
1 package org.bukkit.event.player;
2 
3 import org.bukkit.entity.Player;
6 
7 /**
8  * Fired when a player's item breaks (such as a shovel or flint and steel).
9  * <p>
10  * The item that's breaking will exist in the inventory with a stack size of
11  * 0. After the event, the item's durability will be reset to 0.
12  */
13 public class PlayerItemBreakEvent extends PlayerEvent {
14  private static final HandlerList handlers = new HandlerList();
15  private final ItemStack brokenItem;
16 
17  public PlayerItemBreakEvent(final Player player, final ItemStack brokenItem) {
18  super(player);
19  this.brokenItem = brokenItem;
20  }
21 
22  /**
23  * Gets the item that broke
24  *
25  * @return The broken item
26  */
28  return brokenItem;
29  }
30 
31  @Override
32  public HandlerList getHandlers() {
33  return handlers;
34  }
35 
36  public static HandlerList getHandlerList() {
37  return handlers;
38  }
39 }