Shaped/ShapelessRecipes - How to Keep an Item in the Grid?

Discussion in 'Plugin Development' started by Steeveeo, Feb 4, 2012.

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


    Hello all. I'm working on a quick little plugin that adds recipes that I feel should be a part of Minecraft, but are not. Things like turning sandstone back into sand, or unstickifying a piston.

    My question is: how does one either not consume a set item in the recipe, or how to set it back in as a different ItemStack? Pretty much, how do I replicate the Cake recipe in Bukkit's ShapedRecipe class?

    Specifically, I would like to "grind stone into sand" by having cobble and obsidian in the grid, but not consume the obsidian block.

    Thanks in advance!
  2. Offline


    At this moment in time I do not believe it is possible, however we do have a round of crafting 'fixes' coming up shortly. Maybe Celtic Minstrel can enlighten you further.
  3. Offline


    md_5 Hmm, does that include Shift+Clicking a result not updating the client's inventory properly? Been toying with this for a little bit and noticed that I have to move something in my inventory for the full result to show up.
  4. Offline


    No, Celtic currently has a refactor in the works about being able to edit recipes etc etc
    Better he tell you than me
  5. Offline

    Celtic Minstrel

    What you ask currently isn't possible; at present you can use internal functions to make a specific item always leave something else behind in the crafting grid, but it only works for unstackable items and applies to all recipes that use that item.

    When inventory events come around, this should be possible; you'd catch the crafting event and place the item back on the grid.
  6. Offline


    Celtic Minstrel Alright then, will be looking forward to it.

    BTW, are these "internal functions" private and protected or open to idiots like me who want to make really hackish workarounds? :p
  7. Offline


    Public, in the nms Item class. It's called setContainerItem() in MCP, not sure what Bukkit's mappings call it.
  8. Offline

    Celtic Minstrel

    As I recall it raises an exception if you call it for a stackable item, though.
Thread Status:
Not open for further replies.

Share This Page