Custom item crafting

Discussion in 'Plugin Development' started by EdwardHyde, Sep 23, 2020.

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

    EdwardHyde

    I'm newbie in the plugin programming, so I would like to hear some solution to my problem.
    Problem:
    On the server there is a custom craft of the so-called "Reinforced iron". Craft consists of 4 pieces of ordinary iron. The screenshot below.
    upload_2020-9-23_23-12-8.png
    Code:
    Code:
    ItemStack c_iron = new ItemStack(Material.IRON_INGOT);
            ItemMeta c_iron_meta = c_iron.getItemMeta();
         
            List<String> lore = new ArrayList<String>();
            c_iron_meta.setDisplayName("§fReinforced iron");
            c_iron_meta.addEnchant(Enchantment.ARROW_INFINITE, 10, true);
            lore.add("§7Used to make chain mail.");
            c_iron_meta.setLore(lore);
            c_iron.setItemMeta(c_iron_meta);
         
            ShapedRecipe ciron1 = new ShapedRecipe(c_iron);
            ciron1.shape("** ","** ","   ");
            getServer().addRecipe(ciron1);
         
            ItemStack c_helmet = new ItemStack(Material.CHAINMAIL_HELMET);
            ShapedRecipe chelmet1 = new ShapedRecipe(c_helmet);
            chelmet1.shape("***","* *","   ");
            chelmet1.setIngredient('*', /*my custom material here*/);
    And I would like that this iron was used for crafting chain mail armor
     

    Attached Files:

  2. Offline

    Xp10d3

    What exactly is your problem? Everything seems to work fine.
     
  3. Offline

    Shqep

Thread Status:
Not open for further replies.

Share This Page