I get an error when I use my command to give a custom item.
I use a customitem class i made to make it easiers to make new items
Test item class
public class Test extends CustomItem{
public static ItemStack WaterItem = itemStackName;
public static void waterItemMeta() {
List<String> lore = new ArrayList();
lore.add("Hello!");
itemMeta("iron_ingot", "Water Item", lore, true, true, Enchantment.FIRE_ASPECT, 2);
}
}
Custom Item class
public static ItemStack itemStackName;
public static void itemMeta(String materialName, String displayName, List<String> itemLore, boolean isUnbreakable,
boolean enchanted, Enchantment ench, int lvl) {
Material material = Material.matchMaterial(materialName);
ItemStack customItem = new ItemStack(material);
ItemMeta customMeta = customItem.getItemMeta();
customMeta.setDisplayName(displayName);
customMeta.setLore(itemLore);
customMeta.setUnbreakable(isUnbreakable);
customMeta.addItemFlags(ItemFlag.HIDE_ATTRIBUTES, ItemFlag.HIDE_ENCHANTS, ItemFlag.HIDE_UNBREAKABLE);
if (enchanted = true) {
customMeta.addEnchant(ench, lvl, true);
}
customItem.setItemMeta(customMeta);
itemStackName = customItem;
}