Furnace Recipe

Discussion in 'Plugin Development' started by xaanit, Mar 22, 2016.

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

    xaanit

    https://bukkit.org/threads/how-to-create-a-furnace-recipe.110620/- I looked at this thread and tried to follow it, found it wasn't working so I decided to ask here. Tried:


    Code:
    FurnaceRecipe fleshToLeather =
            new FurnaceRecipe(new ItemStack(Material.LEATHER), Material.ROTTEN_FLESH);
    getServer().addRecipe(fleshToLeather);
    And

    Code:
    getServer().addRecipe(new FurnaceRecipe(new ItemStack(Material.LEATHER), Material.ROTTEN_FLESH));
    Help?
     
  2. Offline

    Zombie_Striker

    Can you explain how it does not work? Does it not turn leather into rotten flesh?
     
  3. Offline

    xaanit

    It's supposed to do the opposite, and I followed exactly what the code was (changing it a bit for mine) and it wasn't working at all.
     
  4. Offline

    Zombie_Striker

    @xaanit
    Try adding the following bit of code:
    Code:
    getServer().addRecipe(new FurnaceRecipe(new ItemStack(Material.LEATHER), Material.ROTTEN_FLESH));
    getServer().addRecipe(new FurnaceRecipe(new ItemStack(Material.ROTTEN_FLESH), Material.DIAMOND));
    One of these two will add the recipe:
    • If the first line is how you add the recipe, then you should get leather when you cook rotten flesh.
    • If the second line is how you add the recipe, and you should get a diamond when you cook rotten flesh.
    Copy those lines into your code, and test which line works. After that, post the results and mark this thread as solved if this solves your problem.
     
    Last edited: Mar 22, 2016
  5. Offline

    xaanit

    @Zombie_Striker

    Neither worked. Tried cooking the leather, rotten flesh, and the diamond just to be safe and nothing came out of anything.
     
  6. Offline

    Zombie_Striker

    @xaanit
    What version of Bukkit/Spigot are you using? More importantly, do you know if the recipe is ever registered/added? Do that by doing the following:
    1. Loop through all of the recipes loaded on the server
    2. If the Recipe is an instanceof FurnanceRecipe, check if the "result's" type is equal to Leather (realized I read the constructor wrong in the other posts.) If that if statement is true, then the recipe has been added.
     
Thread Status:
Not open for further replies.

Share This Page