mojira.dev
MC-276950

Lock container field upgrades incorrectly to handle items with a formatted custom name

Items that were previously able to open a locked container can no longer open locked containers when the item has a custom formatted text component. This is because the container's Lock field is upgraded in a way that tests for an exact component match.

While we can expect data packs and commands to break between versions, it is generally assumed that items and block upgrade without problems.

How to reproduce:

  1. Create a world in 1.21.1 (or in a snapshot before 24w39a)

  2. Place a locked chest

    /setblock ~ ~ ~ chest{Lock:"secret"}
  3. Notice that you cannot open the chest

  4. Give yourself an item to open the chest

    /give @s stick[custom_name='{"text":"secret","color":"red"}']
  5. Notice that you can open the chest when holding the item

  6. Open the world in 24w39a

  7. Notice that you can no longer open the chest when holding the item

Attachments

Comments 5

Thank you for your report!
After consideration, the issue is being closed as Won't Fix.

Please note that this is not the same as Working as Intended, as this bug report correctly describes behavior in the game that might not be the intended or desirable behavior, but it will not be fixed right now. Sometimes, this is because the issue reported is minor and/or impossible to change without large architectural changes to the code base.

Quick Links:
πŸ““ Bug Tracker Guidelines – πŸ’¬ Community Support – πŸ“§ Mojang Support (Technical Issues) – πŸ“§ Microsoft Support (Account Issues)
πŸ““ Project Summary – ✍️ Feedback and Suggestions – πŸ“– Game Wiki

@unknown however, this bug has another aspect. if the lock s password has \ , the game cannot successfully convert the item.

the game log will throw a error and the items "lock" data is completely lost.

Β 

here s my inventory

[media]

Β in an earlier snapshot, and after i opened it in 39a, it became

[media]

Β 

the 2nd items lock data is lost.

Β 

[media]

and all i can see is an error log.

Β 

please consider reopen this bug report

@unknown, that sounds like a separate bug; please create a new bug report for that.

@unknown this bug is reported as MC-276979. but the reporter seems to met some formatting issues right now.

Misode

(Unassigned)

Community Consensus

(Unassigned)

24w39a

Retrieved