Topic category: User side tutorials
This tutorial will explain how to add brewing recipes, but it'll use custom code
In the images, you might see Object obj =
and obj =
, but they aren't necessary
Before we start...
If you made a custom potion element, make sure to enable the potion effect bottles, or you won't be able to brew them
The actual tutorial
- Start by creating a custom code element. You can remove some parts, because they won't be needed
- Copy these lines of code inside the
init
method, then press ctrl+w:
try { Class clazz = net.minecraft.potion.PotionBrewing.class; Method mth = ObfuscationReflectionHelper.findMethod(clazz, "func_193357_a", Potion.class, Item.class, Potion.class); mth.invoke(null, basePotion, ingredient, resultPotion); // To add more recipes, you can copy the line above, for ex. // mth.invoke(null, potion2, item2, potion3); } catch (Throwable e) { System.err.println("ERROR: " + e); // You can change this part }
The final result should look like this:
-
To actually add a brewing recipe, you'll have to replace
basePotion
andresultPotion
with the starting and resulting potions, andingredient
with an item:-
To add a vanilla potion, type
Potions
, then press ctrl+w. Type.
afterPotions
, and the editor should show you the vanilla potions. For example,Potions.AWKWARD
is the awkward potion, whilePotions.LONG_SWIFTNESS
is the extended potion of speed -
To add your custom potions, type the name of your potion element, followed by
Potion.potionType
, then press ctrl+w. For example, if you made a potion element named "Invincibility", you'll have to typeInvincibilityPotion.potionType
-
To use vanilla items and blocks as an ingredient, type
Items
, then press ctrl+w. Add a.
afterItems
, and the editor should now show you the vanilla items and blocks. For example, to use cobblestone, you'll have to typeItems.COBBLESTONE
, while for redstone dust it'sItems.REDSTONE
-
To use modded items/foods, type the name of your element, followed by
Item.block
, then press ctrl+w. For example, if your item element is named MagicDust, you'll have to typeMagicDustItem.block
-
Finally, to use modded blocks/plants, type
Item.getItemFromBlock()
; inside the (), type the name of your element, followed byBlock.block
, then press ctrl+w. For example, if your block element is named SeaGravel, you'll have to typeItem.getItemFromBlock(SeaGravelBlock.block)
This is what your element should look like after adding a brewing recipe
-
-
To add more brewing recipes, you don't have to create other custom elements. You can copy the line that starts with
mth.invoke
and change the potions and item. For example, here I added another recipe that turns potions of regeneration into thick potions
Nice, I believe this will help many :D
Can you add Brewing Recipe with this, Klemen?
this is super helpful
not work :(
Check for typos. I spend half an hour freaking out and attempting to debug mine when it didn't work, only to discover I had spelt "AWKWARD" as "AKWARD"
The item I had as the ingredient wouldn't go in the brewing stand.
The items brewed need to potions? Can I brew food or drinks, maybe something else?
I followed the instructions exactly to try and create a recipe for my flight potion, but when i try to run the game it gives me a cannot find symbol error with an arrow pointing towards the f in flight. Maybe it has to do with the fact that when i type in the fli in flight it automatically fills it in to FlintAndSteelItem. Can anyone help?
Are you sure you're in 1.14.4 or 1.15.2? And have you tried to do ctrl+w or command+w in the editor for it to automatically get the imports? And if your answers are yes, plz send a picture of your code.
I'm in 1.15.2 and yes, i tried ctrl+w. It didn't work. Here's my code:
You may need to replace "FlightPotion.potiontype" by "FlightPotionPotion.potionType"
The Java code is cap sensitive that's why it has to be "potionType" instead of "potiontype" and then, don't forget to do ctrl+w before saving the code to make sure you have all the imports.
That worked. Thanks!
Hi! I'm having trouble adding in my brewing recipe. I've actually put it in, the code throws no errors or anything, but the problem arises when I try to test it out in-game. I can't use the items I would like inside the brewing stand; it won't let me put them into the slots.
Inside the potion slot, I'm just hoping to have a glass bottle. Not a water bottle, an empty glass. I've tried "Potions.EMPTY" and "Items.GLASS_BOTTLE," and neither are accepted into the potion slot. How would I alter the glass bottle item (or the brewing stand GUI, if necessary) to allow me to do this?
Inside the ingredient slot, I'm hoping to put a modded item called Bismuth Chunk. I've put in "BismuthChunkItem.block" and it throws no errors, but I can't actually put the item into the slot for whatever reason. Does it have to do with it not being inside the Potions tab inside the creative inventory? Is it an item tag or something I need to change within the GUI of the brewing stand?
I really appreciate any help you can provide.
I think that the brewing stand GUI isn't programmed to be able to hold glass bottles in the potion slots. Sorry I can't help.