001 package org.bukkit.event.player; 002 003 import org.bukkit.entity.Player; 004 import org.bukkit.event.HandlerList; 005 import org.bukkit.inventory.ItemStack; 006 007 /** 008 * Fired when a player's item breaks (such as a shovel or flint and steel). 009 * <p> 010 * The item that's breaking will exist in the inventory with a stack size of 011 * 0. After the event, the item's durability will be reset to 0. 012 */ 013 public class PlayerItemBreakEvent extends PlayerEvent { 014 private static final HandlerList handlers = new HandlerList(); 015 private final ItemStack brokenItem; 016 017 public PlayerItemBreakEvent(final Player player, final ItemStack brokenItem) { 018 super(player); 019 this.brokenItem = brokenItem; 020 } 021 022 /** 023 * Gets the item that broke 024 * 025 * @return The broken item 026 */ 027 public ItemStack getBrokenItem() { 028 return brokenItem; 029 } 030 031 @Override 032 public HandlerList getHandlers() { 033 return handlers; 034 } 035 036 public static HandlerList getHandlerList() { 037 return handlers; 038 } 039 }