Mojira Archive
MC-118058

Ender dragon named "Dinnerbone" or "Grumm" is not upside-down

The bug

When I summon an ender dragon with this command:

/summon minecraft:ender_dragon ~ ~ ~ {CustomName:"{\"text\":\"Dinnerbone\"}",CustomNameVisible:1b,Silent:1b,NoAI:1b}

the ender dragon is not upside down, so I tried to see if anything was wrong with my command and tried it with a sheep.

/summon minecraft:sheep ~ ~ ~ {CustomName:"{\"text\":\"Dinnerbone\"}",CustomNameVisible:1b,Silent:1b,NoAI:1b}

It did work as the sheep was turned upside down.
I don't know if this is intentional or not, but I hope it's not.

Code analysis

Based on 1.12.2 MCP names.
In the method net.minecraft.client.renderer.entity.RenderDragon.applyRotations() where it applies the dragon's model rotations, it does not have a check if the dragon is named Dinnerbone or Grumm and to rotate if so. To fix this issue, this piece of code can be added at the end of the method applyRotations().

    String s = TextFormatting.getTextWithoutFormattingCodes(entityLiving.getName());

        if (s != null && ("Dinnerbone".equals(s) || "Grumm".equals(s)))
        {
            GlStateManager.translate(0.0F, entityLiving.height + 0.1F, 0.0F);
            GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
        }