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

Consider the following code:

 

List<ItemStack> potion_subtypes = new ArrayList<ItemStack>();

Items.potionitem.getSubItems(Items.potionitem, null, potion_subtypes);

for (ItemStack is : potion_subtypes)
{
    System.out.println(is.getUnlocalizedName() + " =>" + is.getDisplayName());
}

 

It prints the following:

 

item.potion =>Water Bottle
item.potion =>Potion of Regeneration
item.potion =>Potion of Regeneration
item.potion =>Potion of Regeneration
item.potion =>Splash Potion of Regeneration
item.potion =>Splash Potion of Regeneration
item.potion =>Splash Potion of Regeneration
item.potion =>Potion of Swiftness
item.potion =>Potion of Swiftness
item.potion =>Potion of Swiftness
item.potion =>Splash Potion of Swiftness
item.potion =>Splash Potion of Swiftness
item.potion =>Splash Potion of Swiftness
item.potion =>Potion of Fire Resistance
item.potion =>Potion of Fire Resistance
item.potion =>Splash Potion of Fire Resistance
item.potion =>Splash Potion of Fire Resistance
item.potion =>Potion of Poison
item.potion =>Potion of Poison
item.potion =>Potion of Poison
item.potion =>Splash Potion of Poison
item.potion =>Splash Potion of Poison
item.potion =>Splash Potion of Poison
item.potion =>Potion of Healing
item.potion =>Potion of Healing
item.potion =>Splash Potion of Healing
item.potion =>Splash Potion of Healing
item.potion =>Potion of Night Vision
item.potion =>Potion of Night Vision
item.potion =>Splash Potion of Night Vision
item.potion =>Splash Potion of Night Vision
item.potion =>Potion of Weakness
item.potion =>Potion of Weakness
item.potion =>Splash Potion of Weakness
item.potion =>Splash Potion of Weakness
item.potion =>Potion of Strength
item.potion =>Potion of Strength
item.potion =>Potion of Strength
item.potion =>Splash Potion of Strength
item.potion =>Splash Potion of Strength
item.potion =>Splash Potion of Strength
item.potion =>Potion of Slowness
item.potion =>Potion of Slowness
item.potion =>Splash Potion of Slowness
item.potion =>Splash Potion of Slowness
item.potion =>Potion of Harming
item.potion =>Potion of Harming
item.potion =>Splash Potion of Harming
item.potion =>Splash Potion of Harming
item.potion =>Potion of Water Breathing
item.potion =>Potion of Water Breathing
item.potion =>Splash Potion of Water Breathing
item.potion =>Splash Potion of Water Breathing
item.potion =>Potion of Invisibility
item.potion =>Potion of Invisibility
item.potion =>Splash Potion of Invisibility
item.potion =>Splash Potion of Invisibility

 

How come awkward potions, mundane potions and clear potions aren't listed? How do I get a list of the subtypes that include those? Also, how do I get a list of the potions' crafting recipes?

I like trains.

subtypes for potions are computed and cached when asked for. Then only the effective potions (those with a list of effects) actually get returned. Awkward, mundane, milky, stinky, etc. etc. are not effective and therefore not sub-listed.

Those other names are seemingly random based on whatever potion id (damage value) is requested.

Tip: Study net.minecraft.potion.PotionHelper to discover why.

  • Author

That's going to be a bit of a problem because I want to get all the potions and their recipes even if they're not really used.

 

I don't see what I'm supposed to be seeing in PotionHelper.

I like trains.

It's all right there. It is very complicated, so I don't imagine a beginner will understand how it works. Sorry I cannot spell it out for you.

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.