#Add Recipe with tag

9 messages · Page 1 of 1 (latest)

spark veldt
#

I am trying to create 4 "sophisticatedstorage:chest" but the one I want to craft has an nbt tag of {woodType: "spruce"} How can I add this recipe?

This is what I have at the moment but it keeps erroring for me.

// Sophisticated Storage Chest Crafting
  var outputItem = 'sophisticatedstorage:chest{woodType:"spruce"}';
  var outputAmount = 4; // The number of items the recipe will produce

  // Define the shaped recipe
  event.shaped(Item.of(outputItem, outputAmount), ["SSS", "SRS", "SSS"], {
    S: "minecraft:spruce_log",
    R: "minecraft:redstone_torch",
  });
severe stoneBOT
#

Once your ticket has been resolved, please close it with </ticket close:1054771505520717835> command!

noble shoalBOT
#

You can write your code in a codeblock by typing it between the codeblock delimiters:
Note that these are backticks, not apostrophes

```js :arrow_left:

ServerEvents.recipes(event => {
event.smelting('minecraft:glass', '#forge:sand').xp(.1)
})

``` :arrow_left:

This example will look like this:

ServerEvents.recipes(event => {
  event.smelting('minecraft:glass', '#forge:sand').xp(.1)
})
vale crest
#

NBT doesn't work like that for an Item.of, you're supposed to do:

Item.of('item', 4, '{nbt}') //Quote marks are REQUIRED
#

You also don't need to use var, use let

spark veldt
#

its just an old js habit to use var when prototyping sorry haha but I am trying the changes you recommended! thank you!

#

That was it! Thanks for the quick help!

// Sophisticated Storage Chest Crafting
  let outputItem = "sophisticatedstorage:chest";
  let outputAmount = 4; // The number of items the recipe will produce

  // Define the shaped recipe
  event.shaped(
    Item.of(outputItem, outputAmount, "{woodType:'spruce'}"),
    ["SSS", "SRS", "SSS"],
    {
      S: "minecraft:spruce_log",
      R: "minecraft:redstone_torch",
    }
  );
vale crest
#

Np 🙂

noble shoalBOT
#

Please close your ticket (with </ticket close:1054771505520717835> or the button atop this thread) once you resolved your issue! This also helps others that would like to help out, as they don't have to look into this thread to check if it has been resolved by now.

Do you have any other questions regarding your issue? Feel free to ask!
Note: You should generally create a new post for unrelated issues.