Mojira Archive
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;
}

Works As Intended

Marcono1234

[Mojang] Grum (Erik Broes)

2016-01-21, 05:50 PM

2017-05-09, 11:43 PM

2016-09-12, 12:34 PM

0

5

Community Consensus

CustomName, CustomNameVisible, mob

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

-