Solved Add recipe that ignores item durability

Discussion in 'Spigot Plugin Development' started by abilnfMC, Jun 18, 2017.

  1. Hello!
    I want to add a simple recipe for my plugin (Diamond helmet + pumpkin):
    Code (Text):
    ItemStack diamondHelmet = new ItemStack(Material.DIAMOND_HELMET);
    ItemMeta diamondHelmetMeta = diamondHelmet.getItemMeta();
    diamondHelmetMeta.setLore(lore);
    diamondHelmet.setItemMeta(diamondHelmetMeta);
       
    diamondHelmetRecipe = new ShapelessRecipe(diamondHelmet);
    diamondHelmetRecipe.addIngredient(Material.DIAMOND_HELMET).addIngredient(Material.PUMPKIN);
    It works quite ok, but one big issue is, that if the helmet is damaged, it will not work, because the durability changed. Is there any way to ignore this?
    I searched a lot but didn't find anything.

    Thanks for your help, abilnf.
     
  2. Quoting from this post (first result on Google with a search query with your problem):
     
  3. Oh.. thanks.
    I was on this page but somehow I missed this post.