The Bug:
Guardians and elder guardians render outside of their hitboxes when looking up or down.
Steps to Reproduce:
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]}
Enable entity hitboxes by pressing "F3 + B".
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
is duplicated by
relates to
Attachments
Comments


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.
Can confirm for MC 1.12.1.

Confirmed for 1.13
Confirmed for 1.13.1-pre1
Confirmed for 1.13.1

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)

Can confirm for 19w42a
Can confirm in 21w03a.
Can confirm in 21w05b.
Can confirm in 21w06a.
Can confirm in 21w07a.
Can confirm in 21w11a. Relates to MC-156595.

Can confirm in 1.17-rc1.
Can confirm in 1.17.
Can confirm in 1.17.1.
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.
@@unknown, completed.
Thanks, greatly appreciated. 😃
Can confirm in 1.20.2

Confirmed in 24w46a

Confirmed on 1.21.4 Pre-Release 1

can confirm in 1.21.5