Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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?

  • Author
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?

  • Author

hmm. I see. After looking around for a while, I've found I could use `PotionUtils.addPotionToItemStack`

  • 1 year later...

It seemed to work when I needed an Item as a temptation for a Mob `Animal`.

cast `(ItemLike)` ...

Ooops seems I forgot to past the actual.

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

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.