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

Hello, I'd like to find out how to specify a potion in a recipe (i.e. make a Shaped Recipe use a Healing I potion and a few other things, but no other potion is used.). I do know how to make & register normal shaped & shapeless recipes.

If I'm asking a whole bunch of questions, please don't get angry. I'm trying to learn.

Instead of using an Item or a Block use an ItemStack and i believe it is metadata, if not it is nbt.

 

Potions use nbt to differentiate between types. Unfortunately, I don't think vanilla recipes check an ItemStack's NBT data when checking if a recipe is valid, so you're probably going to have to make your own IRecipe class. (Although it shouldn't be that hard. Pretty much exactly the same as ShapedRecipe, just override ShapedRecipe#checkMatch to check for NBT data as well). Minecraft nicely provides PotionUtils, which has a method called getPotionFromItem that you can use to check a given ItemStack's potion type against the one you desire.

  • Author

I found how to use specific potions in recipes. I used TheMasterGabriel's method, by using PotionUtils.

Example code for future googlers:

new PotionUtils.addPotionToItemStack(new ItemStack(Items.POTIONITEM), PotionTypes.STRONG_HEALING));

If I'm asking a whole bunch of questions, please don't get angry. I'm trying to learn.

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.