mojira.dev
MC-249699

Potions in worlds from before 1.9 become water bottles when upgraded

The bug

Potions in worlds which were last loaded in 1.8.9 or an earlier version will become water bottles if loaded in the latest version instead of staying the potion they were.

How to reproduce

  1. Create a world in a pre-1.9 version

  2. Obtain a potion via your desired method

  3. Load this world in 1.18.2 or whatever the latest major release is

  4. Note what the potion is

Alternatively, I've attached four world files:

  • one is a base world from 1.3.2

  • one is the base world loaded in 1.8.9

  • one is the base world loaded in 1.12.2

  • one is the base world loaded in 1.8.9 and then 1.12.2
    These worlds can be used to reproduce this issue (as well as MC-249700 and MC-232104) instead of creating such a world yourself.

Expected results

The potion would... remain a potion?

Actual results

It becomes a water bottle.

Further notes

This is without a doubt related to the major refactoring done to potion formatting in 1.9.

Code analysis

Code analysis by @unknown in duplicate MC-277902.

Linked issues

Attachments

Comments 6

Um, your screenshots state the opposite/show downgrading❓

The first is from a 1.3.2 world loaded in 1.8.9, then 1.12.2 and finally 1.18.2, the second is from one loaded in 1.8.9 and then straight to 1.18.2.

Might want to specify that in the report/screenshots.

i can confirm in 1.19.3 and 23w04a

I think the issue is that the datafixer for potions uses getOptionalTyped(tag_field) instead of getOrCreateTyped(tag_field) so it never actually runs because the lookup for item stack nbt data hasn't been created yet. This should be a trivial fix.

muzikbike

(Unassigned)

Confirmed

Platform

Normal

Datafixer

data-fixer

Minecraft 18w19a, 1.18.2, 1.19.3, 23w04a, 1.21.1, 24w36a, 1.21.3

Retrieved