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

Hi,

I'm using a method to create a brewing recipe, and it is asking for Ingredient, all I can see from the Ingredient class is to get an item, however, I need to specify a paticular potion, how would I do this?

You can use PotionUtils.addPotionToItemStack, then use the resulting stack as an ingredient.

I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.

  • Author
2 minutes ago, imacatlolol said:

You can use PotionUtils.addPotionToItemStack, then use the resulting stack as an ingredient.

Okay....

So I have

BrewingRecipeRegistry.addRecipe(Ingredient.fromStacks(PotionUtils.addPotionToItemStack(here, Potions.AWKWARD)));

 

But I'm not sure what to put for 'here' as it wants an ItemStack..

Just now, modders2 said:

But I'm not sure what to put for 'here' as it wants an ItemStack..

You would create a new item stack of whatever type of potion you're trying to make. Items.POTION, Items.SPLASH_POTION, and Items.LINGERING_POTION are the vanilla ones. You could either do new ItemStack(item) or item#getDefaultInstance() to get a stack of any item.

I'm eager to learn and am prone to mistakes. Don't hesitate to tell me how I can improve.

  • Author
15 minutes ago, imacatlolol said:

You would create a new item stack of whatever type of potion you're trying to make. Items.POTION, Items.SPLASH_POTION, and Items.LINGERING_POTION are the vanilla ones. You could either do new ItemStack(item) or item#getDefaultInstance() to get a stack of any item.

Okay, so I've done this and I have the following:

BrewingRecipeRegistry.addRecipe(Ingredient.fromStacks(PotionUtils.addPotionToItemStack(new ItemStack(Items.POTION), Potions.AWKWARD)), Ingredient.fromItems(ItemList.PEPPERS.get()), PotionUtils.addPotionToItemStack(new ItemStack(Items.POTION),  PotionList.MORE_HEALTH_POTION.get()));

 

Only problem with this, is that I can put one in, and it brews fine, however, putting more than one in will just keep brewing, it is accepting all potions, and overriding them if they aren't the output one

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

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.