player.inventory.consumeInventoryItem(yourItem)
if(stack.stackSize <= 0){
player.inventory.setInventorySlotContents(player.inventory.currentItem, null);
}
if (par3EntityPlayer.inventory.hasItem(youItem)){
par3EntityPlayer.inventory.consumeInventoryItem(yourItem);
....
}