How can I set the ingredient quantity in a crafting recipe?

Discussion in 'Plugin Development' started by emptify, Jul 22, 2022.

Thread Status:
Not open for further replies.
  1. Offline

    emptify

    Hello, I have created a plugin with a custom crafting recipe and wanted to ask if it is possible to set a certain amount for setIngredient.

    My code:

    ItemStack diamant = new ItemStack(Material.DIAMOND, 1);
    NamespacedKey key = new NamespacedKey(this, "diamond_from_iron");
    ShapedRecipe recipe = new ShapedRecipe(key, diamant);
    recipe.shape(" D ");recipe.setIngredient('D', Material.IRON_INGOT);Bukkit.addRecipe(recipe);
     
  2. Offline

    FoxinatorDev

    You can create an ItemStack with a custom amount and set that as an ingredient.
     
Thread Status:
Not open for further replies.

Share This Page