Custom furnace recipes

Discussion in 'Plugin Development' started by TomShar, Jun 1, 2012.

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

    TomShar

    I've tried a few things but I can't get it to work:
    new FurnaceRecipe(new ItemStack(351, (byte) 15), Material.SUGAR);
    should turn sugar into bonemeal
     
  2. Offline

    Redstone_Craft

    That's because you don't bind it to a byte. take off the (byte) >.>

    Also that turns bonemeal into sugar you did it reverse

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 26, 2016
  3. Offline

    TomShar

    They are not the problems.
    They are the correct way and you can have (byte)

    I'm not sure where to put it, an event? onEnable?
     
  4. Furnace recipes don't accept data value from the game, the source code only enters the ID of the item and ignores the data value.
    I've submitted a bug report of this, you should vote it so it gets fixed (or added, because it's a game default tough): https://bukkit.atlassian.net/browse/BUKKIT-1657


    Still, you did it wrong there beacuse ItemStack's 2nd argument is amount, not data value.
    Doesn't really matter, it will start working the moment you add it... but like I said, it won't accept data values.
    Also, the 1st argument of FurnaceRecipe is the result and the 2nd is the ingredient, so in your example you're smelting sugar to make 15 ink sacks.
     
  5. Offline

    TomShar

    hm ok. thanks so if I don;'t use a data value that will work.

    Changed to something without byte data. Still doesn't work.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 26, 2016
  6. Did you use getServer().addRecipe() ?

    Also, if you just want to add custom recipes for your server, you can use RecipeManager :p
     
  7. Offline

    Redstone_Craft

    Try something like getServer().addFurnaceRecipe()
    or
    Bukkit.addFurnaceRecipe()
     
  8. There isn't such method, the only one is addRecipe() which accepts Recipe which is extended by FurnaceRecipe, ShapedRecipe and ShapelessRecipe...
     
  9. Offline

    Redstone_Craft

    Then looks like I got mixed up with ModLoader.addFurnaceRecipe() again >.>
     
Thread Status:
Not open for further replies.

Share This Page