[TUTORIAL] Custom brewing recipes (1.14/1.15)

Started by SomeoneElse on

Topic category: User side tutorials

Joined Nov 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
[TUTORIAL] Custom brewing recipes (1.14/1.15)
Mon, 07/06/2020 - 18:56 (edited)

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
 

Check if the bottles are enabled!

The actual tutorial

  1. Start by creating a custom code element. You can remove some parts, because they won't be neededA new custom code element

     

  2. 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:
     

    Code after pasting

     

  3. To actually add a brewing recipe, you'll have to replace basePotion and resultPotion with the starting and resulting potions, and ingredient with an item:

    • To add a vanilla potion, type Potions , then press ctrl+w. Type . after Potions, and the editor should show you the vanilla potions. For example, Potions.AWKWARD is the awkward potion, while Potions.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 type InvincibilityPotion.potionType

    • To use vanilla items and blocks as an ingredient, type Items, then press ctrl+w. Add a . after Items, and the editor should now show you the vanilla items and blocks. For example, to use cobblestone, you'll have to type Items.COBBLESTONE, while for redstone dust it's Items.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 type MagicDustItem.block

    • Finally, to use modded blocks/plants, type Item.getItemFromBlock(); inside the (), type the name of your element, followed by Block.block, then press ctrl+w. For example, if your block element is named SeaGravel, you'll have to type Item.getItemFromBlock(SeaGravelBlock.block)

      This is what your element should look like after adding a brewing recipe

      After adding one recipe

       

  4. 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

    Adding a second brewing recipe

     

 

Edited by SomeoneElse on Mon, 07/06/2020 - 18:56
Joined Sep 2017
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This is epic, I was making a…
Fri, 02/05/2021 - 19:26

This is epic, I was making a mod all about potions and then I realized I didn't know how to make a brewing recipe. You saved me.

Joined Mar 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Is there some way to use…
Tue, 03/02/2021 - 20:28

Is there some way to use this in 1.16.4 beta snapshot MCreator

Joined Jul 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to add splash and…
Wed, 06/02/2021 - 19:11

How to add splash and lingering potions?

Joined May 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Someone can tell me a code…
Sat, 06/12/2021 - 23:33

Someone can tell me a code that works in 1.16.5?

Joined Jun 2020
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
This is epic. It is better…
Mon, 07/26/2021 - 03:39

This is epic. It is better than u give it credit for. Even in 2021.2 snapshots, I'm using this. It solves 3 main problems with the built-in brewing recipes.

1. You can't define specific Potions to be brewed, only Uncraftable empty potions

2. It does not have built-in support for splash/lingering potions

3. It's code is clean

 

Also another benefit about this that the built-in one does have

 

Works in 1.16.x :)

 

So to sum it up

Epic epic pog pog upvote pog 

Joined Oct 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Could you make a 1.16.5…
Sat, 10/02/2021 - 21:52

Could you make a 1.16.5 version?

Joined Jun 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Wow! Thanks a lot! Even…
Sat, 11/27/2021 - 07:54

Wow! Thanks a lot! Even though I am in 1.16, it works!