Solved My customs recipes don't work

Discussion in 'Plugin Development' started by BlaSfaiMe, Mar 18, 2020.

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

    BlaSfaiMe

    Hi !
    I've a problem with my customs recipes and I don't know why
    Code (open)

    Code:
    ItemStack fireStaff = new ItemStack(Material.BLAZE_ROD);
            ItemMeta staffMeta = fireStaff.getItemMeta();
            staffMeta.setDisplayName("§6Fire §eStaff");
            ArrayList<String> lore = new ArrayList<>();
            lore.add("§fUse §cit §fand do cool §cthings");
            staffMeta.setLore(lore);
            fireStaff.setItemMeta(staffMeta);
            NamespacedKey staffKey = new NamespacedKey(this, "fire_staff");
            ShapedRecipe staffRecipe = new ShapedRecipe(staffKey, fireStaff);
            staffRecipe.shape(
                    "CFC",
                    "DBD",
                    " E "
            );
            staffRecipe.setIngredient('C', Material.COAL_BLOCK);
            staffRecipe.setIngredient('F', Material.FLINT_AND_STEEL);
            staffRecipe.setIngredient('D', Material.DIAMOND);
            staffRecipe.setIngredient('B', Material.BLAZE_ROD);
            staffRecipe.setIngredient('E', Material.EMERALD);
            Bukkit.getServer().addRecipe(staffRecipe);

    Could you help me ?
     
  2. Offline

    timtower Administrator Administrator Moderator

    @BlaSfaiMe Define "Don't work"
    Do you get errors? Aren't they showing up?
     
  3. Offline

    BlaSfaiMe

    No, finnaly, it's working ! I just don't use the correct item ^^'
     
Thread Status:
Not open for further replies.

Share This Page