mojira.dev
MC-119372

Guardians and elder guardians render outside of their hitboxes when looking up or down

The Bug:

Guardians and elder guardians render outside of their hitboxes when looking up or down.

Steps to Reproduce:

  1. Summon a guardian and elder guardian looking down by using the commands provided below.

    /summon minecraft:elder_guardian ~ ~ ~ {NoAI:1b,Silent:1b,Rotation:[0f,75f]}
    /summon minecraft:guardian ~ ~ ~ {NoAI:1b,Silent:1b,Rotation:[0f,75f]}
  2. Enable entity hitboxes by pressing "F3 + B".

  3. Take note as to whether or not guardians and elder guardians render outside of their hitboxes when looking up or down.

Observed Behavior:

Guardians and elder guardians render outside of their hitboxes.

Expected Behavior:

Guardians and elder guardians would not render outside of their hitboxes.

Related issues

Attachments

Comments

migrated
[media][media][media][media]
migrated

i think, this is like an animation for an attack, like a iron golem trows up his arms. But when in this animation, the hitbox doesnt change.
They must remove the animation, the change of hitbox because of the animation would be much more difficult i think.

bemoty

Can confirm for MC 1.12.1.

migrated

Confirmed for 1.13

Asteraoth

Confirmed for 1.13.1-pre1

Asteraoth

Confirmed for 1.13.1

migrated

I've identified the cause of this.
All entity models are created 1.5 blocks below where they should render, and then moved up by a little over 1.5 blocks in the rendering process. I don't know why it's done this way but it is. The issue is, the guardian model does not set a pivot/rotation point, and it defaults to [0, 0, 0] (relative to the entity position) which is above where the model is. When the model is rendered, everything is shifted up 1.5 blocks, putting the model in the correct place, but the pivot point is now at [0, 1.5, 0] which is way too high.

The correct location for the pivot, in my opinion, would be at 0.5 blocks above the bottom of the guardian, or 1.0 blocks below the default pivot.

In MCP 1.12.2 naming the code solution would be, in the constructor of net.minecraft.client.model.ModelGuardian, the following line needs to be added:

this.guardianBody.setRotationPoint(0.0F, 1.0F, 0.0F);

(entities are modelled upside-down so using a positive value here shifts the pivot point downwards from its default)

migrated

Can confirm for 19w42a

Avoma

Can confirm in 21w03a.

Avoma

Can confirm in 21w05b.

Avoma

Can confirm in 21w06a.

Avoma

Can confirm in 21w07a.

Avoma

Can confirm in 21w11a. Relates to MC-156595.

Brevort

Can confirm in 1.17-rc1.

Avoma

Can confirm in 1.17.

Avoma

Can confirm in 1.17.1.

Avoma

I'd like to request ownership of this ticket since the current reporter has been inactive for several years. I'm willing to continue to provide all of the necessary details and will keep this report updated accordingly.

[Mod]Les3awe

@@unknown, completed.

Avoma

Thanks, greatly appreciated. 😃

[Mod] Jingy

Can confirm in 1.20.2

Minecraft386882

Confirmed in 24w46a 

migrated

Confirmed on 1.21.4 Pre-Release 1

ouroya

can confirm in 1.21.5

Avoma

(Unassigned)

Confirmed

Platform

Important

Hitboxes

elder_guardian, guardian

Minecraft 1.12, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 18w05a, Minecraft 18w21b, ..., 24w46a, 1.21.4 Pre-Release 1, 1.21.4, 25w08a, 1.21.5

Retrieved