Solved Custom Enchantment book recipe

Discussion in 'Plugin Development' started by ZderKi, Jun 14, 2019.

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


    So i created this custom recipe for an enchantment book, but it doesnt work in anvil and i cant apply this enchantment book to any item throught the anvil... any help?

    heres my code
                ItemStack item1 = new ItemStack(Material.ENCHANTED_BOOK, 1);
                ItemMeta meta1 = item1.getItemMeta();
                meta1.setDisplayName("Book of Sharpening");
                ArrayList<String> lore1 = new ArrayList<String>();
                //lore.add(ChatColor.GOLD + "");
                meta1.addEnchant(Enchantment.DAMAGE_ALL, 1, true);
                ShapedRecipe sharpnessbook = new ShapedRecipe(item1);
                sharpnessbook.shape("*  "," BB"," B%");
                sharpnessbook.setIngredient('*', Material.FLINT);
                sharpnessbook.setIngredient('%', Material.IRON_SWORD);
                sharpnessbook.setIngredient('B', Material.PAPER);
    Last edited: Jun 14, 2019
  2. Offline


    I could be wrong but try making the type Material.ENCHANTED_BOOK. Other than that i can't help you. I have no experience with custom enchants and items.
  3. Offline


    tried that

    nvm solved it

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

Share This Page