Jump to content

DataGen: Help with multiple items for a recipe.


Recommended Posts

I have been following this tutorial for my mod, though I am wondering how I add multiple items in the ModRecipeProvider class. 

        ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.LEMON_JUICE.get(), 4)
                .requires(ModItems.LEMON.get())
                .save(pWriter);

I am wanting to add the Glass Bottle to the recipe though I am not sure how. (As seen in the .json file below).

{
  "category": "misc",
  "ingredients": [
    {
      "item": "droidsancientrelics:lemon"
    },
    {
      "item": "minecraft:glass_bottle"
    },
    {
      "item": "minecraft:glass_bottle"
    },
    {
      "item": "minecraft:glass_bottle"
    },
    {
      "item": "minecraft:glass_bottle"
    }
  ],
  "result": {
    "count": 4,
    "item": "droidsancientrelics:lemon_juice"
  },
  "type": "minecraft:crafting_shapeless"
}

Would this be easy to perform?

Link to comment
Share on other sites

Just add another .requires after the first one. You can even specify how many should be needed. In your case, that would look like: 

ShapelessRecipeBuilder.shapeless(RecipeCategory.MISC, ModItems.LEMON_JUICE.get(), 4)
                .requires(ModItems.LEMON.get())
                .requires(Items.GLASS_BOTTLE, 4)
                .save(pWriter);
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.