I'm making a plugin using 1.16 spigot API and I'm stuck trying to get an itemStack in the recipe. I was using 1.8 spigot API but when I'm realized that I was either in need of a third party API or making my own crafting system I chose to change from 1.8 to 1.16
Recipe
NamespacedKey key = new NamespacedKey(this, "emerald_sword");
ShapedRecipe recipe = new ShapedRecipe(key, sword);
recipe.shape(" E ", " E ", " S ");
recipe.setIngredient('E', RecipeChoice.ExactChoice(enchantedEmerald));// part not working
recipe.setIngredient('S', Material.STICK);
Bukkit.addRecipe(recipe);
Emerald sword
ItemStack sword = new ItemStack( Material.DIAMOND_SWORD );
ItemMeta IM = sword.getItemMeta();
IM.setDisplayName(ChatColor.GREEN + "Emerald Sword" );
sword.setItemMeta( IM );
sword.addEnchantment( Enchantment.DAMAGE_ALL, 5 );
Enchanted emerald
ItemStack enchantedEmerald = new ItemStack( Material.EMERALD );
ItemMeta EEM = enchantedEmerald.getItemMeta();
EEM.setDisplayName("enchanted Emerald");
ArrayList<String> lore = new ArrayList<String>();
lore.add("enchanted Emeralds is an rare material");
EEM.setLore(lore);
enchantedEmerald.setItemMeta(EEM);
the order is the emerald sword, enchanted emerald, and recipe
how can I use itemStack in a recipe?