Jump to content

[1.15.2] How do you add Potion Recipes?


Rotartsi

Recommended Posts

So I've been trying to add a potion into the game with forge 1.15. I've got the potion showing up in the creative menu, but don't know how to add a brewing stand recipe. I see that I could use `BrewingRecipeRegistry.addRecipe`, but it seems to take `Ingredient`s as arguments, and I'm not sure how to use that (how do i get potions as ingredients? I can't even get them as items! they are types of the same item: minecraft:potion).

 

Here's the code that I have to add the potion to the creative inventory:

```

public static final DeferredRegister<Potion> REGISTER = new DeferredRegister<>(ForgeRegistries.POTION_TYPES, MODID); public static final RegistryObject<Potion> LEVITATION = REGISTER.register("potion_levitation", () -> new Potion(new EffectInstance(Effects.LEVITATION, 900)));

```

and I would run `REGISTER.register(FMLJavaModLoadingContext.get().getModEventBus());` in the appropriate event handler.

 

I'm intending to implement the recipe

 - Levitation Dust (from my mod, "mymod:levitation_dust") + Awkward Potions = Potion of Levitation

I want this potion to be able to be made into splash/lingering potions and be able to add glowstone and redstone to make it stronger or longer.

 

How would I do that?

Link to comment
Share on other sites

7 hours ago, diesieben07 said:

Ingredient is basically just a predicate ("test function") that checks if something matches an ingredient slot. This is used as an abstraction for recipe inputs (a recipe input might be just a single item or match all items that have a given tag, etc.). Check out the Ingredient.fromXXX factory methods.

I see the fromItems() factory method, but how do I get my potion as an item?

Link to comment
Share on other sites

  • 1 year later...
  • Guest locked this topic
Guest
This topic is now closed to further replies.

Announcements



×
×
  • Create New...

Important Information

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