mojira.dev
MC-269274

"minecraft:" sometimes required for key name in data merge

How to reproduce

  1. Place an item frame with an item in it

  2. Run the following command 

    /data merge entity @e[type=item_frame,sort=nearest,limit=1] {Item: {components:{"custom_name": '{"text":"Hello"}'}}}
  3. ✔ Notice that the item was given the custom name as expected

  4. Run the following command to change the custom name

    /data merge entity @e[type=item_frame,sort=nearest,limit=1] {Item: {components:{"custom_name": '{"text":"World!"}'}}}
  5. ❌ The item wasn't renamed, the command silently failed, and an error was logged to the console

    [00:45:25] [Server thread/ERROR]: Tried to load invalid item: 'Duplicate entry for key: 'b[type=minecraft:custom_name, removed=false]' missed input: {custom_name:'{"text":"World!"}'}'
  6. Now run the following command to rename the item, including the minecraft: prefix

    /data merge entity @e[type=item_frame,sort=nearest,limit=1] {Item: {components:{"minecraft:custom_name": '{"text":"World!"}'}}}
  7. ✔ Notice that this worked

Linked issues

Comments 5

I'm not sure if this is related to MC-269271

which I submitted earlier. It seems reversed, in that here the nbt path does not require the prefix, where there it does. I put this in just to potentially add useful info, but I'd personally guess they have different fixes.

Found another case: On an armor stand holding a shield, 

/data get entity 0bb8a90b-3333-4fcf-be1b-31f61f9bd3d3 HandItems[1].components.banner_patterns[0].color

does nothing, but

/data modify entity 0bb8a90b-3333-4fcf-be1b-31f61f9bd3d3 HandItems[1].components.minecraft:banner_patterns[0].color set value blue

works

Cannot reproduce on a new item. When I drop an item and run following command, the item gets named as expected

/data merge entity @e[type=item,sort=nearest,limit=1] {Item: {components:{"custom_name": '{text:"fool"}'}}}

However running that same command on an already named item on the ground leads to your observed results.

This might be related to MC-268833

Thank you for your report!
After consideration, the issue is being closed as Working as Intended.

Please note, that mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.

Full Version HistorySnapshot Version HistoryThe official Minecraft feedback site

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

It is intended that users have to remember a few random instances in which "minecraft:" is required, when 99% of the time it is not? "Not fixing in the next release, priority too low" would make sense. But "we're happy with this, it seems good!" has got to be wrong.

kcrca

(Unassigned)

Confirmed

Commands

24w10a

Retrieved