Specific Potion Types in Recipes

Started by Timelord_10 on

Topic category: Help with Minecraft modding (Java Edition)

Joined Mar 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Specific Potion Types in Recipes

Hey, I was trying to make a crafting recipe, so that certain potion types can be combined to make other potions. I was doing this with a custom crafting block, using procedures. However, I did notice that there isn't an option to chose specific potion types (like a Wither Potion, or Splash Potion of Poison). Does anyone know a work around? Any help is appreciated! ;)

The only workaround at the…
Sat, 01/19/2019 - 15:42

The only workaround at the moment would be custom code, so you set the proper metadata of the potion in the recipe code.

Joined Jun 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Would this metadata be nbt…
Sun, 01/27/2019 - 22:50

Would this metadata be nbt tag data?  Or similar to how you used to get a subset of an item (block, etc), such as "dark oak planks" would be like "minecraft:wood_planks:5" (you of course now use "dark_oak_planks")?  And where would it go in the code?  Each ingredient is like so in the code:
 

'1', Ingredient.fromStacks(new ItemStack(Blocks.PLANKS, (int) (1), 5))

Note I used "dark oak planks" in the above example as one of the ingredients, and how it ends in '5'.  Is that the # that has to be changed to use a specific potion as an ingredient?

Thanks!

Joined Jun 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ok, well, since we're…
Tue, 01/29/2019 - 23:47

Ok, well, since we're talking about using a potion in a recipe:

The Minecraft wiki shows that a specific type of potion is stored in an nbt tag.  So, if I wanted to get a Healing II potion, I'd issue the command:
 

/give @p minecraft:potion 1 0 {Potion:"minecraft:strong_healing"}

The Minecraft id is obviously "minecraft:potion".  But how do I get that nbt tag into the code so that I can use a *specific* type of potion for a recipe ingredient?  Can I just do this:
 

'1', Ingredient.fromStacks(new ItemStack(Blocks.POTIONITEM, (int) (1), "minecraft:strong_healing"))

?

Because using a number there instead does nothing at all.  I've even used the old numerical values for potions (i.e., the "Damage" value, such as "minecraft:potion:8373") to get a particular potion and nothing seems to work. :-/

Thanks!

 

I have found this on this…
Wed, 01/30/2019 - 14:31

I have found this on this page (http://www.minecraftforge.net/forum/topic/41540-1102-solved-specifying-…):

PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.STRONG_HEALING));

to use it in your code:

'1', Ingredient.fromStacks(PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.STRONG_HEALING));)

 

Joined Jun 2014
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Ooh, it *doesn't* need to be…
Wed, 01/30/2019 - 16:22

Ooh, it *doesn't* need to be an integer.  Hot diggity dog!  You're my hero.

Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
As I am very new to all this…
Sun, 05/17/2020 - 12:53

As I am very new to all this and only know the most basic basics about programming, could you please tell me where exactly I have to put that code in? :§

Joined May 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
what does that  '1' stand…
Mon, 05/18/2020 - 18:11

what does that  '1' stand for?

Joined Mar 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
: ItemStack.EMPTY).getItem()…
Mon, 03/21/2022 - 21:41
: ItemStack.EMPTY).getItem() == Items.NETHER_WART
                    && (entity instanceof ServerPlayer _plrSlotItem && _plrSlotItem.containerMenu instanceof Supplier _splr
                            && _splr.get()instanceof Map _slt ? ((Slot) _slt.get(3)).getItem() : ItemStack.EMPTY)
                                    .getItem() == Items.GLISTERING_MELON_SLICE) {
                if (entity instanceof ServerPlayer _player && _player.containerMenu instanceof Supplier _current
                        && _current.get()instanceof Map _slots) {
                    ItemStack _setstack = new ItemStack(Items.POTION);
                    _setstack.setCount(1);
                    ((Slot) _slots.get(0)).set(_setstack);
                    _player.containerMenu.broadcastChanges();

i see in line 7 here that is my output slot I am trying to turn into a healing potion. How would i go about altering this code so it becomes my healing potion?

Joined Jan 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do i put a specific…
Tue, 01/02/2024 - 06:24

How do i put a specific potion into a trader example healing potion?