[MC-1705] Creative Menu potion values are odd, not the same as when brewed Created: 01/Nov/12  Updated: 07/Jul/17  Resolved: 10/Feb/13

Status: Resolved
Project: Minecraft: Java Edition
Component/s: None
Affects Version/s: Minecraft 1.4.2
Fix Version/s: None

Type: Bug
Reporter: UncleMion Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: potion
Environment:

Windows XP (x86) version 5.1, Java 1.6.0_31


Attachments: Text File potionlistgen.txt    
Issue Links:
Duplicate
duplicates MC-6551 Creative Menu potion values are not t... Resolved
Confirmation Status: Unconfirmed
Game Mode: Creative

 Description   

ISSUE:

When you take a Potion from the Creative Menu brewing tab, its numeric value is larger than it should be. The bits that don't have to do with the potion effect requirements are all set to 1.

This doesn't seem to affect using the Potions, but since some of the bits set to 1 control whether you can add more ingredients, you can do some odd brewings.

For example, try taking a 3-minute Potion of Fire Resistance from the Creative Menu, putting it in a Brewing Stand, and adding a Ghast Tear. It will brew into a 22-second Potion of Regen II.

LIKELY CAUSE & FIX:

I took a look at (MCP)ItemPotion.getSubItems(), which generates the set of Potion items for the brewing tab. Currently it loops through the possible values 0 - 32767, adding values that create potions to a List indexed by the potion effect. This means that, if more than one potion value produces the same effect, the list will end up with the largest potion value for that particular effect - hence all the "don't-care" bits are set.

A quick fix? Try looping from 32767 to 0 so you get the smallest potion value for each effect. Note that this may cause other problems if some bits aren't set, so it'll take some checking.

EDIT:
I've attached a piece of code for you to try in (MCP)ItemPotion.getSubItems(). It will account for missing Healing/Harming potions and use the smallest value for each potion effect.



 Comments   
Comment by UncleMion [ 07/Nov/12 ]

I've also noticed that the drinkable Potion of Healing & Potion of Harming are not in the creative menu. They seem to map to the same potion effects as their splash versions, probably since they're instant.

Updating the description with a bit of MCP code that does the job of covering both the splash & non-splash instant potions and using the smallest potion value for each effect.

(Maybe you could make MC-1517 the duplicate instead of this issue, considering that this has more detail and a fix?)

Comment by UncleMion [ 06/Nov/12 ]

Hmm, although MC-1517 is describing the same sort of problem, my issue description has a lot more info and an explanation. Is there a good way to say "look at MC-1705 for gory details"?

Comment by Do [ 06/Nov/12 ]

Thanks for catching it.

Comment by UncleMion [ 01/Nov/12 ]

This issue probably duplicates MC-1517.

Generated at Sun Jan 12 11:55:21 UTC 2025 using Jira 9.12.2#9120002-sha1:301bf498dd45d800842af0b84230f1bb58606c13.