Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-95950

Mobs with CustomNameVisible set to true show their default name

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Works As Intended
    • None
    • 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
    • Community Consensus

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

            grum [Mojang] Grum (Erik Broes)
            marcono1234 [Mod] Marcono1234
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: