mojira.dev
MC-95950

Mobs with CustomNameVisible set to true show their default name

The bug

When you set CustomNameVisible to 1b for a mob it displays its default name. This is not the case for other entities.

How to reproduce

  1. Use the following command

    /summon Cow ~ ~ ~ {NoAI:1b,Health:0.1f,CustomNameVisible:1b}

    The cow has the name "Cow"

  2. Use the following command

    /summon MinecartRideable ~ ~ ~ {CustomNameVisible:1b}

    The name is not displayed

The reason

The following is based on a decompiled version of Minecraft 1.10 using MCP 9.30.

The method net.minecraft.client.renderer.entity.RenderLiving.canRenderName(T) should test if the value of the tag CustomNameVisible is true and if the entity has a custom name.

protected boolean canRenderName(T entity)
{
    // Replaced this
    // return super.canRenderName(entity) && (entity.getAlwaysRenderNameTagForRender() || entity.hasCustomName() && entity == this.renderManager.pointedEntity);
    return super.canRenderName(entity) && entity.getAlwaysRenderNameTagForRender() && entity.hasCustomName() && entity == this.renderManager.pointedEntity;
}

Linked issues

Comments 17

If this is resolved as WAI someone please remember to have MC-95905 reopened.

Confirmed for 1.9

Still in 1.9.1-pre1

Still in 1.9.1-pre3

I assume that the behaviour described in MC-95905 is rather a bug. Setting CustomNameVisible to 1b means that the person who did this wants a name to be shown.

The following is based on decompiled version of Minecraft 1.9 using MCP 9.24 beta. All method and class names are the names used in the decompiled version.

The reason why this is different for mobs than for entities is very likely because players have their CustomNameVisible set to false however the method net.minecraft.entity.player.EntityPlayer.getAlwaysRenderNameTagForRender() returns always true for them.
The affected method for entities would be net.minecraft.client.renderer.entity.Render.canRenderName(T).

7 more comments

That's what I said.
It's intended.

I wonder how the helpers can't figure something as easy as this. No Offence but the helpers didn't even consider understanding the tag.

What are you implying here, is what I meant.

@unknown this report is about the fact that CustomNameVisible:1b shows the default name of mobs, which is not a custom name and because of this confusing because the tag suggests that it only shows custom names but not the default ones.

Well of course if no one set the custom name, probably the custom name would be the default. I mean that the developers probably set the names as the custom. First of all, there is no tag such as "Default name"(Heh Heh), AND, if you say the names that are displayed by default using the customname tag are default, I would rather say that it should be visible when the mobs are just spawned.
Also it is better if those names(such as "Cow" on a cow) are visible, as you will know that the command is working. It would be better then there was nothing, just like it is on the minecart.

Although I understand what the reporter meant, why should the developers trouble themselves over something as puny as this? Aren't I right?

This is not the place for discussions, but like I said it is inconsistent and against what you would expect.

marcono1234

Erik Broes

Community Consensus

CustomName, CustomNameVisible, mob

Minecraft 16w03a, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 1, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.9.2, Minecraft 16w15b

Retrieved