mojira.dev
MC-78862

Setting CustomName to a blank string doesn't remove the custom name

Rename a mob (I used a villager) to lets say, Bob.

Try to remove the name by using {CustomName:""}

It won't change the name.
Edit:
I've been told that setting the name to " " will remove the name, but not the nameplate.
This should be corrected regardless, since I assume it is not working as intended.

White-space trimming should be turned off, and rendering the name plate should check for both CustomName tag existing, and it not being blank.

The only way to correct this is to kill the mob, and spawn in a new one, which is very inconvenient if you've spent a while trying to fuss with other tags to make your mob display right.

Comments 14

Using /entitydata on a blank CustomName string to replace names do not work. However, changing a name using CustomName does work (from Bob to Bobb).

Setting the name to " " clears the name.

Carl Nathans

No it doesn't.
It leaves a blank box above the entity's head because the space is there.

A blank box removes the custom name.

4 more comments

Confirmed for

  • 1.8.4

How to reproduce:

  1. */summon ArmorStand ~ ~ ~ {CustomName:"a",CustomNameVisible:1}*

  2. */entitydata @e[type=ArmorStand,r=5] {CustomName:""}*
    it will say *...CustomName:"",...*

  3. */entitydata @e[type=ArmorStand,r=5] {}*
    it will say *...CustomName:"a",...*

Note: The underlying problem seems to be that the NBT parser handles an empty string as if the tag is not given. This can be experience as well with Signs: MC-87143: https://bugs.mojang.com/browse/MC-87143?focusedCommentId=246146&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-246146

Anybody still able to reproduce?

It's been over a year since the question was asked, please respond to the question or attach the files requests and keep the ticket updated.

Cannot confirm either for 17w06a

Mike Dueck

(Unassigned)

Community Consensus

Minecraft 1.8.3, Minecraft 1.8.4

Minecraft 1.11.2

Retrieved