Optional tags gets removed when set to false/0/empty
The Bug
When the CustomNameVisible tag is set to false (0b) the game automatically removes the tag from the NBT data of the Entity. This also affects newly summoned Entities which do not have it by default if it is not true.
This is a big problem as you cannot test for it then.
Steps to Reproduce
- Summon a husk with its "CustomNameVisible" tag set to "0b".
/summon minecraft:husk ~ ~ ~ {CustomNameVisible:0b} - Use the data command on the husk to inspect the value of its "CustomNameVisible" tag.
/data get entity @e[type=minecraft:husk,limit=1,sort=nearest] CustomNameVisible
→ Notice how the error message, "Found no elements matching CustomNameVisible" is displayed in the chat, therefore indicating that optional NBT data tags get removed when set to "0", "false", or "empty".
Expected Behavior
The expected behavior would be that optional NBT data tags would not get removed when set to "0", "false", or "empty".
Created Issue:
CustomNameVisible tag gets removed when set to false / 0
When the CustomNameVisible tag is set to false (0b) the game automatically removes the tag from the NBT data of the Entity. This also affects newly summoned Entities which do not have it by default if it is not true.
This is a big problem as you cannot test for it then.
CustomNameVisibletag gets removed when set to false/ 0Optional tags gets removed when set to false/0/empty
is duplicated by
Is this still an issue in the most recent versions (currently that is 1.10.2, or 16w43a) of Minecraft? If so, please update the affected versions and help us keeping this ticket updated from time to time. If you are the owner/reporter of this ticket, you can modify the affected version(s) yourself.
relates to
relates to
When the CustomNameVisible tag is set to false (0b) the game automatically removes the tag from the NBT data of the Entity. This also affects newly summoned Entities which do not have it by default if it is not true.
This is a big problem as you cannot test for it then.The Bug
When the CustomNameVisible tag is set to false (0b) the game automatically removes the tag from the NBT data of the Entity. This also affects newly summoned Entities which do not have it by default if it is not true.
This is a big problem as you cannot test for it then.Steps to Reproduce
- Summon a husk with its "CustomNameVisible" tag set to "0b".
/summon minecraft:husk ~ ~ ~ {CustomNameVisible:0b}- Use the data command on the husk to inspect the value of its "CustomNameVisible" tag.
/data get entity @e[type=minecraft:husk,limit=1,sort=nearest] CustomNameVisible
→ Notice how the error message, "Found no elements matching CustomNameVisible" is displayed in the chat, therefore indicating that optional NBT data tags get removed when set to "0", "false", or "empty".
Expected Behavior
The expected behavior would be that optional NBT data tags would not get removed when set to "0", "false", or "empty".
is duplicated by
relates to
Thank you for your report!
However, this issue has been closed as a Duplicate of MC-87252.
It has been linked to this report. If you have additional information, please add it to that report.
Please search before reporting, as it's likely that one exists already.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki
- The NBT key has no capitals (so "powered")
- The NBT is a byte (so 0b/1b, not 0/1, those will never succeed in tests unless the NBT is an int.)
- See MC-87252. Use nbt=!{powered:1b} to target uncharged ones as the tag is optional and will not exist if the default value (0b) is used, as such testing for it being 0b won't succeed.
Resolving as a duplicate of MC-87252.

Confirmed.
Might be intended because this tag is optional and its default value is 0.
Moreover the same seems to happen with the Silent tag
happens with all optional tags, IsBaby,
IsVillager, VillagerProfessionand NoAI are also effected.in my opinion these should exist if you specify them in the summon/entitydata, regardless of value
Tested it further, /summon minecraft:zombie ~ ~ ~
{IsBaby:0}actually does guarantee that it won't be a baby (while normally there's a small chance that it will be), which is further evidence that this is a bug.
@Calvin no this is no evidence for that. If you just provide an empty compound it would already prevent the randomization.
Oh okay.
Confirmed in 1.15.2 and 1.16 Release Candidate 1.
Related to MC-80975.
Confirmed for 1.16.1.
I am able to confirm this behavior in both 1.17.1 and 21w38a. Here are some extra details regarding this problem.
The Bug:
Optional NBT data tags get removed when set to "0", "false", or "empty".
Steps to Reproduce:
/summon minecraft:husk ~ ~ ~ {CustomNameVisible:0b}Expected Behavior:
The expected behavior would be that optional NBT data tags would not get removed when set to "0", "false", or "empty".
Can confirm for 1.18.1 and 22w05.
Can confirm in 1.18.2 and 22w19a.