Jump to content

[1.12.2] Creating a brewing recipe to an already existing potion


ciroreed

Recommended Posts

Hello, how to I register a brewing for an existing potion?

 

To give some context I just want to create recipes for this mod https://www.curseforge.com/minecraft/mc-mods/potion-core

 

Im a developer but quite illiterate on java env. I understand that I have to reference potion-core's jar in my code in order to tie the recipes and potions.

 

I was looking on the internet about doing so but I can't stull find exactly what im looking for..

 

For instance Charm mod coffee potion ctor:

 

    public CoffeePotion()
    {
        super("coffee", false, 0x160202, 3);

        List<PotionEffect> effects = new ArrayList<>();
        effects.add(new PotionEffect(MobEffects.SPEED, Coffee.duration * 20));
        effects.add(new PotionEffect(MobEffects.HASTE, Coffee.duration * 20));
        effects.add(new PotionEffect(MobEffects.STRENGTH, Coffee.duration * 20));
        PotionEffect[] potionEffects = effects.toArray(new PotionEffect[0]);

        type = new PotionType(name, potionEffects).setRegistryName(new ResourceLocation(getModId(), name));
        ProxyRegistry.register(type);

        ItemStack cocoa = new ItemStack(Items.DYE, 1, 3);
        PotionHelper.addMix(PotionTypes.WATER, Ingredient.fromStacks(cocoa), type);
    }

 

I see that here the author is creating a PotionType rather than using an already existing Potion.

 

What PotionCore provides is a bunch of Potions > package net.minecraft.potion.Potion

 

However PotionHelper.addMix only seems to work with PotionType 😕

 

Im a bit lost over here xd

 

Any help appreciated :)

 

Link to comment
Share on other sites

  • Guest locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

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