@SuppressWarnings("deprecation") public static boolean itenInHandIs(ItemStack itemInHand, ItemStack item, boolean containsData) { if(containsData) { if(itemInHand != null && itemInHand.getType().getId() == item.getType().getId() && itemInHand.getAmount() >= item.getAmount() && itemInHand.getDurability() == item.getDurability()) return true; } else { if(itemInHand != null && itemInHand.getType().getId() == item.getType().getId()) return true; } return false; }