mojira.dev
MC-98320

deadmau5's ears are offset while sneaking and while flying with elytra

The bug

When a player named "deadmau5" sneaks or flies with an elytra (and rotates his head), his ears are offset.

How to reproduce

  1. Copy the latest version folder in the .minecraft\versions directory and append _custom to the copied name, resulting in for example 1.12-pre5_custom

  2. Delete the .jar file inside the folder

  3. Append _custom to the version .json file name as well

  4. Replace the content of the version .json file with the following

    {
      "id": "#VERSION#_custom",
      "time": "2038-01-19T03:14:07+00:00",
      "releaseTime": "2038-01-19T03:14:07+00:00",
      "type": "snapshot",
      "minecraftArguments": "--username deadmau5 --version ${version_name} --gameDir ${game_directory} --assetsDir ${assets_root} --assetIndex ${assets_index_name} --uuid 1e18d5ff643d45c8b50943b8461d8614 --accessToken ${auth_access_token} --userType ${user_type} --versionType ${version_type}",
      "inheritsFrom": "#VERSION#",
      "jar": "#VERSION#"
    }
  5. Replace all occurrences of #VERSION# with the version id you created a copy of, for example 1.12-pre5

  6. Select this version in the launcher and start the game

  7. Switch to third person view (F5) and sneak

Code analysis

by @unknown

The method net.minecraft.client.renderer.entity.layers.LayerDeadmau5Head.doRenderLayer() doesn't check if the to be rendered entity is sneaking. Thus, a simple way to fix the sneaking issue would be to add that specific check, which translates the ears a bit down. (I don't know the exact "sneak-shrink"-value, 0.25F is just an example!)

net.minecraft.client.renderer.entity.layers.LayerDeadmau5Head.doRenderLayer()

// ...
if(entitylivingbaseIn.isSneaking()) {
	GlStateManager.translate(0F, 0.25F, 0F);
}
float f2 = 1.3333334F;
GlStateManager.scale(1.3333334F, 1.3333334F, 1.3333334F);
this.playerRenderer.getMainModel().renderDeadmau5Head(0.0625F);
// ...

The fix I found for the elytra-flying issue is very similar to my proposed fix on MC-75279 – clamping the pitch of the ears does the job. Again, the values (-30F, -60F) are only examples, there may be other, way better values to use here.

net.minecraft.client.renderer.entity.layers.LayerDeadmau5Head.doRenderLayer()

// ...
float f1 = entitylivingbaseIn.prevRotationPitch + (entitylivingbaseIn.rotationPitch - entitylivingbaseIn.prevRotationPitch) * partialTicks;
GlStateManager.pushMatrix();
if(entitylivingbaseIn.isElytraFlying()) {
	f1 = MathHelper.clamp(f1, -60F, -30F);
}
// ...

Note: I do not own the username "deadmau5" neither do I know the person owning it personally. The attached screenshots were created by using "deadmau5" as username. The screenshots were taken for testing purposes.

Linked issues

Attachments

Comments 16

What happens when gliding?

Yes, they are offset when you rotate your head (pitch) while flying. The look also pretty strange when you rotate your head very fast.

Confirmed in 1.12.2

Does this affect swimming?

6 more comments

I can confirm for 1.16.4 too. Also, I'd like to request ownership to keep the ticket updated.

Thanks, you are now the reporter @unknown.

I can confirm for 1.17. Why won't you fix it?

Because it's a joke feature. No serious project manager would prioritise this over anything else. The time it would take to fix it would not be spent on actually useful things.

Marcono1234

[Mod] markderickson

(Unassigned)

Confirmed

(Unassigned)

deadmau5, ears, elytra, skin, sneaking

Minecraft 1.9 Pre-Release 4, Minecraft 1.9, Minecraft 1.11, Minecraft 1.12 Pre-Release 5, Minecraft 1.12.1, ..., 20w51a, 21w03a, 21w07a, 21w08b, 21w10a

Retrieved