mojira.dev
MC-1207

Head rotates in the wrong direction while riding

The bug

It affects all gamemodes, when you are riding a mob (no minecart or boat) and you look around in this person view, it twists your head backwards if you look in the opposite direction of the mob.

Here is a video demonstrating it:
http://www.youtube.com/watch?v=5zV4kRict30

Code analysis

See @unknown's comment.

Related issues

MC-2924 Head backwards MC-8108 sometimes peoples faces look glitched when riding a pig MC-10400 When riding a pig which is riding a minecart, your body spins and your head doesn't. MC-10737 Head can be on backwards if riding pig in minecart (doesn't move) MC-10866 Riding a pig glitch MC-17480 When player on pig and pressed f5 head will spin MC-48046 Head backwards while riding a Pig / Viewpoint not updated when pig rotates MC-49500 Head rotates in the wrong direction while riding a horse MC-52484 Creepy head rotating when riding a pig MC-55713 Strange player rotation on untamed horses and donkeys (no saddle) MC-65927 Head turns backwards when on a mount MC-66904 Bug, pig riding=backwards head. MC-73507 Player heads are backwards when riding animals MC-73591 When riding an entity and going into third person view mode, your head is rendered incorrectly MC-75946 Riding a pig MC-78475 Player's head turns 360 when turning around on a horse MC-83208 Mobs riding Shulker turn head 360° MC-83451 3rd Person Horse Render Bug MC-88536 Player model goes a bit wonky when sitting on a NoAI pig! MC-89497 Incorrect player model while shooting bow on a pig MC-91227 Taming and Riding Horses Broken MC-94232 Weird rendering MC-96626 16w05b - F5 mode sitting on pig, body twists... MC-99280 Player model wrong when riding a horse MC-99521 player's head is backwards when looking behind them on horses MC-100988 Pig and Elytra model glitch MC-102487 Riding pig, equipment character bug MC-104649 backwards spider jockey spider heads MC-105017 Head twisting when riding pig MC-108052 Head rotation problem MC-108232 When you're riding and at second-person-sight your head might be rendered wrong MC-108400 When player riding or sitting on llamas and when llamas start spinning around, the player head is turned in the opposite direction MC-114169 When riding an armour stands, players heads rotate at twice the rate of their body

Attachments

Comments

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

I can duplicate this easily.

kumasasa

Confirmed. When riding a minecart or boat the whole player turns when the head turns, but on a pig the pig and player stands still and only the head rotates owl-like.

migrated

I Thought that was a feature to make it more like riding like a horse

migrated

Confirmed on snapshot 13w06a

migrated

This is the same of MC-1545.

migrated

Confirmed for Donkey in 14w19a.

migrated

confirmed for 14w31a

migrated

confirmed for 14w32b

migrated

Confirmed for 1.8-pre1.

migrated

Confirmed for 1.8-pre3

migrated

Confirmed for 1.8.

migrated

I can also confirm for 1.8.1-pre3

migrated

I can confirm for Minecraft 1.8.1 and 1.8.2-pre1

onnowhere

Confirmed 1.8.3

migrated

This has happened to me. I'm not sure if it's fixed by now as it only happened yesterday before I logged off, so...yea!

migrated

Confirmed for 1.8.4, appears to be effective whenever the player is riding any entity, including armor stands and all mobs that weren't mentioned here. It also appears to invert the yaw aspect of the head as well as the pitch.

migrated

Not only for players, I spawned a zombie with my head riding a zombie horse. The head was backewards on it, too!

It makes it hard to take what I was building seriously.

migrated

Confirmed in 1.8.7.

migrated

Confirmed for 1.8.8.

migrated

Confirmed for 15w43c.

migrated

Confirmed for 15w44a.

onnowhere

Confirmed 15w46a 😞

migrated

Please add that this effects riding all mobs aside from Boats

migrated

Can confirm for 15w51b. This also affects mobs riding other mobs (or Armor Stands in my case)

JUE13

Confirmed for 16w06a

migrated

Can confirm for Release 1.9.

migrated

confirmed for 1.9.2

FaRo1

Confirmed for 1.10.1.

FaRo1

Before everyone starts adding random entities, I removed the list. And as I was already on it, I changed the description. I'm pretty sure that minecarts and boats are the only exceptions to this, but if there are more, feel free to correct me.

migrated

Confirmed for 16w39a.

migrated

Confirmed for 1.11.

migrated

Confirmed for 17w06a.

migrated

Confirmed for 17w15a.

JUE13

Confirmed for 17w18b

me4502

So I've been looking into this issue, and it appears to be caused by the rotation offset applied in doRender, in RenderLivingBase. If an entity is riding an entity that extends EntityLivingBase, the 'f' value is modified, which is the rotation point for the body.

This is applied as a global rotation, which breaks head rotations. f2 could be modified, however that's linked to body rotation eventually as well. It appears it'll need to pass extra info through to solve this.

(Everything using MCP names for 1.11.2)

marcono1234

@@unknown to be honest I think the bug is that you can rotate that far at all. Instead the rotation should be restricted like it is currently the case with boats.

migrated

@marcono1234 I disagree with that completely. Yes, specific things like boats should restrict rotation. However there was a use case that I had (years ago at this point, so idr) that would rotate an entity with no AI separately from the entity it was riding.

I'm pretty sure I was attempting to use an armor stand as a marker for where a villager was standing while rotating the villager to face a specific direction. I think I would have had to rotate both the armor stand and the villager to face that direction if I wanted to get it to work correctly. It would be even worse if I had to rotate the armor stand specifically before the villager, otherwise the villager would pop back to whatever direction it is forced to look by what you are suggesting.

me4502

After extensive testing, I can say that the highlighted line in the following image fixes the problem without any loss of functionality: http://i.imgur.com/H06P4AI.png

This is using MCP names, but should be super easy to transfer to MC names.

migrated

Confirmed for 1.12.

me4502

I can confirm this was fixed in 1.12 using the above code. I had a quick chat to Grum and he confirmed that it was merged in for 1.12, and I've re-ran the tests I ran when I made the patch with vanilla 1.12 and it is working as it should.

migrated

Jens Bergensten

Confirmed

carrot_on_a_stick, head, passengers, pig-riding, riding, rotation

Minecraft 1.4.2, Minecraft 1.4.7, Snapshot 13w09a, Minecraft 1.5, Minecraft 1.5.1, ..., Minecraft 17w15a, Minecraft 17w17b, Minecraft 17w18a, Minecraft 17w18b, Minecraft 1.12

Minecraft 1.6.2, Minecraft 1.12

Retrieved