Jump to content

Why does Items.potionitem.getSubItems() have missing entries?


UntouchedWagons

Recommended Posts

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

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