'/data remove' can't remove the NBT "CustomName"
The bug
The /data remove command can't remove the NBT CustomName.
How to reproduce
- Type this command:
/summon spider ~ ~ ~ {CustomName:"{\"text\":\"Grumm\"}"}→
You can see its name by looking at it - Type this command:
/data remove entity @e[type=spider,limit=1,sort=nearest] CustomName
→
Its name should be removed, but it isn't
Expected behavior
The name of the entity should be able to be removed using the /data remove command.
Linked Issues
is duplicated by4
relates to10
- Fixed
Lunarianjellywayne
[Mojang] slicedlime- 57
- 35
- Confirmed
Important
- Platform
- Commands
- commands nbt
18w14b - 1.21.3
18w14b 18w15a 18w16a 18w22c 1.13-pre1 1.13-pre6 1.13-pre7 1.13 18w30b 18w31a 1.13.1-pre1 1.13.1-pre2 1.13.1 1.16-pre2 1.16.4 20w49a 21w05b 21w06a 1.17.1 1.18.1 1.18.2 22w13a 22w18a 1.19 1.19.1-pre4 1.19.1-rc2 1.19.1 1.19.2-rc1 1.19.2 1.19.3 1.19.4 1.20.1 1.20.2 23w43b 1.20.4 23w51b 24w05b 24w06a 24w07a 24w09a 24w13a 1.20.5-pre4 1.20.5-rc2 1.20.5 1.20.6-rc1 1.20.6 24w20a 24w21b 1.21 1.21.1 1.21.2 1.21.3- 1.21.4-pre1
Created Issue:
"data remove" can't remove the nbt "CustomName"
1. Type this command:
{\"text\":\"Grumm\"}
/summon spider ~ ~ ~ {CustomName:""}
We can see its name by looking at it.2. Type this command:
/data remove entity @e[type=spider,limit=1,sort=nearest] CustomName
Its name should be removed, but it didn't.
1. Type this command:
{\"text\":\"Grumm\"}
/summon spider ~ ~ ~ {CustomName:""}
We can see its name by looking at it.2. Type this command:
/data remove entity @e[type=spider,limit=1,sort=nearest] CustomName
Its name should be removed, but it didn't.
"data remove"can't remove the nbt "CustomName"'/data remove' can't remove the nbt "CustomName"
is duplicated by
relates to
is duplicated by
The bug
The /data remove command can't remove the NBT CustomName.
How to reproduce
- Type this command:
/summon spider ~ ~ ~ {CustomName:"{\"text\":\"Grumm\"}"}→
You can see its name by looking at it
- Type this command:
/data remove entity @e[type=spider,limit=1,sort=nearest] CustomName→
Its name should be removed, but it isn't
Expected behavior
The name of the entity should be able to be removed using the /data remove command.
relates to
relates to
is duplicated by
relates to
is duplicated by
relates to
Thank you for your report!
We're tracking this issue in MC-128225, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
– I am a bot. This action was performed automatically! Please report any issues on Discord or Reddit
As far as I can tell, ``/data remove`` does not work.
There are a slew of bug reports about it not working for specific things, such as
In fact, I have yet to find anything on which the command actually does work, though I'm sure there are some somewhere – you must have unit tests that work at some level.
What I suspect is that the pattern of these bugs not been noticed as a general problem, just as a bunch of individual, low priority issues.
What I expect is that either remove works, or it is removed from the doc as not really part of the command if you're not going to fix it.
It is now impossible to delete an entity's name.
Previously, setting an entity's CustomName to "" would clear its name entirely.
This is the only method to do this, as /data remove doesn't work on CustomName, at all.
(see MC-128225 for that issue)
However, with the recent changes to text parsing, setting an entity's CustomName to "" wouldn't work anymore (it still ran, but as if nothing happened), removing this tool from the system for good. It is now impossible to delete an entity's name.
Please fix this, as this has been a thing for so long before 1.20.3 (and now 1.20.4)'s release.
Such a change permanently removes datapack creators' abilities to erase an entity's name, which is crucial for projects that does that very thing, which has been around for a very long time.
Can confirm:
2023-12-13_17-48-47.mp4
Nico4play: Stop reposting information that adds nothing new to the report. Everything you have to say has already been said (MC-267259 included), and every comment sends unnecessary email notifications to watchers.
Yes, MC-267259 is a thing, and is working as intended, and yes, this issue (MC-128225) is a more important problem now, as already stated by [Mojang] Maxime Lebrot in this comment. That's why the Mojang Priority for this ticket has been bumped from "Low" to "Important".
Thank you for your report!
We're tracking this issue in MC-128225 and MC-267259, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
– I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.
Thank you for your report!
We're tracking this issue in MC-128225, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
– I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.
Item Modifier: no_custom_name.json
{
"function": "set_components",
"components": {
"!minecraft:custom_name": {}
}
}
Using this item modifier, it is not possible to remove a custom name from an item.
1. Try give yourself an item with a custom name:
/give @p stick[custom_name='"Custom"']
2. Try to delete the custom name
/item modify entity @s weapon.mainhand test:no_custom_name
3. No error, it succeeds. But the name remains.
(relates to: MC-128225, perhaps?)

Does reloading the world (leave and enter) fix it?
No, its nbt still has CustomName value
It still exist in 18w15a
Comfirmed in 18w16a
You can update the affected versions yourself, no need to comment.
Confirmed for Minecraft 1.13-pre7
Affects 18w31a.
Affects 1.13.1-pre2.
Confirmed for 18w43c
Confirmed for 1.14.1
Confirmed in 1.16 Pre-release 2.
Just to make it clear – this seems to be general. I can't remove saddles from horses, items from frames, ...
Can confirm in 21w05b.
Can confirm in 21w06a.
As a workaround you can just use data modify to set it to any non-JSON string, it will throw and end up clearing the existing name
Can confirm in 1.17.1. Video attached.
@tryashtar can you give an example? I find that the the non-JSON string is simply rejected by the command parser and so never executed. And, say, to remove horse armor I've tried things like setting the specific armor slot to "air" or to Count:0, which don't work.
/summon pig ~ ~ ~ {CustomName:'"test"'} /execute as @e[type=pig,name=test] run data modify entity @s CustomName set value ""Ah, yes, thanks, good to have this in the text!
I agree that this works for CustomName, and I'd guess for other string properties.
However, my bug was marked a dup of this one, and I was looking at non-string properties, such as SaddleItem. And it does not work (afaict) for a horse's SaddleItem. I tried
/data modify entity f4d501d5-adc6-4bff-8d79-07924348f0a5 SaddleItem set value ""
{id:""}/data modify entity f4d501d5-adc6-4bff-8d79-07924348f0a5 SaddleItem set value
/data modify entity f4d501d5-adc6-4bff-8d79-07924348f0a5 SaddleItem set value
{id:"",Count:0b}/data modify entity f4d501d5-adc6-4bff-8d79-07924348f0a5 SaddleItem set value
{id:"",Count:0}Other things that don't work: {}
{id:"\"\""}So it's a workaround for some cases, but not all I'm afraid.
Following up, I have found that my specific problem about saddles can be solved using the /item command, as in:
/item replace entity @e[tag=armor_horse] horse.saddle with air
For some reason, there is no "remove" subcommand of item
This is not a general answer, it only works for attributes that are supported in the item command, but it's a workaround for some cases.
Requesting ownership of this ticket since the current reporter has been inactive since May of 2019. I'm willing to keep this report updated and will continue to provide all of the necessary information.
Can confirm in 1.18.1.
Can confirm in 1.18.2 and 22w13a.
Can confirm in 1.19.
Just stumbled upon this bug myself. Made me very confused as to why my functions weren't working properly for a couple days before I realized this command simply just wasn't working. But I've found for the time being, an easy fix is instead of running /data remove entity @s CustomName, use /data modify entity @s CustomName set value ''
Can confirm in 1.19.1 Pre-release 4.
Can confirm in 1.19.1 Release Candidate 2
Can confirm in 1.19.1
Can confirm in 1.19.2 Release Candidate 1
Relates to
MC-179815, MC-153392,MC-122008,MC-207605, MC-135044,MC-248264.Can confirm in 23w43a / 1.20.2: requesting ownership to make it easier to update (the OP has been inactive since 05/2019).
This is now a crucial problem I think.
Removing CustomName is now outright impossible to do due to
MC-267259Nico4play: Stop reposting information that adds nothing new to the report. Everything you have to say has already been said (
MC-267259included), and every comment sends unnecessary email notifications to watchers.Yes,
MC-267259is a thing, and is working as intended, and yes, this issue (MC-128225) is a more important problem now, as already stated by [Mojang] Maxime Lebrot in this comment. That's why the Mojang Priority for this ticket has been bumped from "Low" to "Important".[Mod] Turbo I get It. I was just trying to get a reason why my messages were removed. Thank you for explaining
Can confirm in 24w06a
Just did a quick code analysis and it seems like this bug could be solved like this:
A similar fix can also be applied to other places, specifically command blocks, containers, beacons, banners and enchanting tables.
An alternative way would be to make a method dedicated to retrieving a custom name, with the same code as above, that returns the custom name.
The fix comes from removing the custom name if the tag is not present. Through testing, this seems to work as expected, /data remove does remove the custom name, other types of changes also don't cause any issues.
Can confirm in 24w07a and 24w09a
Can confirm in 24w10a, 24w11a, 24w12a and 24w13a
This still exists all the way up to 1.20.5 Prerelease 3.
Still exist in 1.20.5-rc1.
It seems like we won't be able to remove custom names for 2 versions in a row after having been able to in another way since 1.13. Ouch.
Still exists in 1.20.5-rc2.
Sadly, this is still the case in Release 1.20.5.
Still exists in 1.20.6-rc1. Is this even a critical bug?
Confirmed in 1.21.2
Confirmed in 1.21.3