Mojira Archive
MCPE-162780

Changing the arm position also affects attachable animations

Why this needs to be fixed:

If fixing MCPE-47877, the first-person positioning of attachables would get messed up. Again, because this also happened once in 1.17.0 when capes are enabled (MCPE-126660), causing major problems with the positioning animation of attachable items.

When changing the player's arm position in player_firstperson.animation.json, for some reason it also changes the positioning of attachable items, such as crossbows, tridents, bows, shields, and spyglasses.

To reproduce:

  1. Join a world, and see that the positioning of tridents, bows, etc are fine.
  2. Download the resource pack attached, that should fix MCPE-47877.
  3. Enable it and once again join the world
  4. Look at these items again, and notice how their position changed.

Expected results:

Their position remains the same.

Actual results:

Their position is changed, with no actual reason.

Code analysis

this comment.

There seems to be a 'rightitem' bone responsible for binding attachables in the animation.player.first_person.empty_hand (which controls the arm positioning in the player_firstperson.animation.json file). It is also a is a "child" of the 'rightarm' bone. It looks like changing the position of the arm also changes the position of the right item, messing up the positioning of the attachable items.

        "animation.player.first_person.empty_hand": {
            "loop": true,
            "bones": {
                "rightarm": {
                    "position": [ 13.5, -10.0, 12.0 ],
                    "rotation": [ "95.0 + variable.is_using_vr * 7.5", "-45.0 + variable.is_using_vr * 7.5", "115.0 + variable.is_using_vr * -2.5" ]
                },
                "rightitem": {
                    "position": [ 0.0, "q.get_default_bone_pivot('rightarm',1) - q.get_default_bone_pivot('rightitem',1) - 7.0", "-q.get_default_bone_pivot('rightitem',2)" ]
                },
                "leftitem": {
                    "position": [ 0.0, "q.get_default_bone_pivot('leftarm',1) - q.get_default_bone_pivot('leftitem',1) - 7.0", "-q.get_default_bone_pivot('leftitem',2)" ]