"minecraft:" sometimes required for key name in data merge
How to reproduce
- Place an item frame with an item in it
- Run the following command
/data merge entity @e[type=item_frame,sort=nearest,limit=1] {Item: {components:{"custom_name": '{"text":"Hello"}'}}}
Notice that the item was given the custom name as expected- 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!"}'}}}
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!"}'}'
- 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!"}'}}}
Notice that this worked
Linked Issues
Created Issue:
"minecraft:" sometimes required for key name in data merge
Given an item frame (with an item in it), the command
/data merge entity 9e65de07-3d69-4b5d-8bec-14784038700c {Item: {components:{"custom_name": '{text:"fool"}'}}}
will fail, with an error (only in the console) of
[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:"foo;l"}'}'
On the other hand, if I include the "minecraft:" prefix, it works:
/data merge entity 9e65de07-3d69-4b5d-8bec-14784038700c {Item: {components:{"minecraft:custom_name": '{text:"fool"}'}}}It also works to use "data modify" with the nbt path of Item.components.custom_name, that does not require the prefix.
Removed Category: (Unassigned)
Added Linked Issues:
relates to
Changed Description:
Given an item frame (with an item in it), the command
/data merge entity 9e65de07-3d69-4b5d-8bec-14784038700c {Item: {components:{"custom_name": '{text:"fool"}'}}}
will fail, with an error (only in the console) of
[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:"foo;l"}'}'
On the other hand, if I include the "minecraft:" prefix, it works:
/data merge entity 9e65de07-3d69-4b5d-8bec-14784038700c {Item: {components:{"minecraft:custom_name": '{text:"fool"}'}}}It also works to use "data modify" with the nbt path of Item.components.custom_name, that does not require the prefix.
How to reproduce
- Place an item frame with an item in it
- Run the following command
/data merge entity @e[type=item_frame,sort=nearest,limit=1] {Item: {components:{"custom_name": '{"text":"Hello"}'}}}Notice that the item was given the custom name as expected
- 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!"}'}}}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!"}'}'- 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!"}'}}}Notice that this worked
This might be the same issue as MC-269274. I can no longer reproduce the item getting deleted in 24w10a, instead the command is ignored.
- Placing a shulker box containing a diamond sword with sharpness V
- Running the command:
/data modify block x y z Items[0].components.enchantments.levels."minecraft:sharpness" set value 1 - The item is not deleted, but the above command was simply ignored
- Running the command:
/data modify block x y z Items[0].components."minecraft:enchantments".levels."minecraft:sharpness" set value 1
- The sharpness level is modified to 1 as expected
I'm not sure if this is related to
MC-269271which 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,
does nothing, but
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-268833Thank 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 History – Snapshot Version History – The 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.