Using Custom Items for Custom Recipes?

Discussion in 'Plugin Development' started by Solaba, Aug 4, 2013.

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

    Solaba

    How do I make recipes only makeable by custom items? Such as if I had:
    Code:java
    1. ItemStack chain = new ItemStack(Material.IRON_FENCE);
    2. ItemMeta chainmeta = chain.getItemMeta();
    3. chainmeta.setDisplayName(ChatColor.GRAY + "Chain Link");
    4. List<String> chainlore = new ArrayList<String>();
    5. chainlore.add(ChatColor.ITALIC + "Used for Chainmail.");
    6. chainmeta.setLore(chainlore);
    7. chain.setItemMeta(chainmeta);


    Then I tried to make chain legs with it, such as:

    Code:java
    1. ShapedRecipe chainleg = new ShapedRecipe (new ItemStack(Material.CHAINMAIL_LEGGINGS, 1));
    2. chainleg.shape("LLL","L L","L L");
    3. chainleg.setIngredient('L', new MaterialData(Material.IRON_FENCE, chain.getData().getData()));


    Now, with this code, I can make chain legs with both the "Chain Link" as-well as normal Iron Fence, I'm wondering how to make it to where its only craftable by "Chain Links."

    Bump with reformat and new question.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 3, 2016
Thread Status:
Not open for further replies.

Share This Page