Jump to content

[1.16.5 official mapping] Specifying potion in recipe builder (Solved)


Recommended Posts

Posted (edited)

How can I specify potions in recipes?

ShapelessRecipeBuilder.shapeless(ModItems.POSION_APPLE.get())
                .requires(Items.APPLE)
                .requires(Ingredient.of(PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.POISON)))
                .unlockedBy("has_item", has(Items.APPLE))
                .save(consumer);

It's not work
 

Edited by reasure
Posted
ShapelessRecipeBuilder.shapeless(ModItems.POISON_APPLE.get())
                .requires(Items.APPLE)
                .requires(NBTIngredient.of(PotionUtils.setPotion(new ItemStack(Items.POTION), Potions.POISON)))
                .unlockedBy("has_item", has(Items.APPLE))
                .save(consumer);

It's not work too

Posted
{
  "type": "minecraft:crafting_shapeless",
  "ingredients": [
    {
      "item": "minecraft:apple"
    },
    {
      "item": "minecraft:potion"
    }
  ],
  "result": {
    "item": "reasurecraft:poison_apple"
  }
}

Here is Json file

Posted

NBTIngredient doesn't have an of method itself, you're actually calling Ingredient.of. You need to create an instance of NBTIngredient directly (or a class that extends it, since the constructor is protected).

Please don't PM me to ask for help. Asking your question in a public thread preserves it for people who are having the same problem in the future.

  • reasure changed the title to [1.16.5 official mapping] Specifying potion in recipe builder (Solved)
Posted (edited)
{
  "type": "minecraft:crafting_shapeless",
  "ingredients": [
    {
      "item": "minecraft:apple"
    },
    {
      "type": "forge:nbt",
      "item": "minecraft:potion",
      "count": 1,
      "nbt": "{Potion:\"minecraft:poison\"}"
    }
  ],
  "result": {
    "item": "reasurecraft:poison_apple"
  }
}

It worked! Thank you!!!

Edited by reasure

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.

Announcements



×
×
  • Create New...

Important Information

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