Make held items follow bent arms and straighten the first-person arm #3

Merged
selimaj-dev merged 1 commits from held-items into master 2026-09-26 18:31:22 +00:00
Owner

Held items

Items were drawn at the hand of the unbent arm. PlayerModelMixin hooks the end of PlayerModel.translateToHand and adds one more rigid transform (BendTransforms.attachAt). It's the same move the ring at the hand makes, so the item stays in the fist and turns with the forearm, the way the end of the sleeve does.

The hook is on PlayerModel because it overrides translateToHand (to handle slim arms) and never calls HumanoidModel's version. This needed two Stonecutter branches:

  • the class moved to model.player in 1.21.11
  • the method gained a render-state parameter in 1.21.9

First-person arm

The first-person arm is drawn from the same shared model without calling setupAnim, so it kept whatever bend the last third-person player drawn had left. FirstPersonHandMixin clears it in renderHand.

Tester

  • A new hold animation (arm forward, forearm folded up).
  • The gametest now takes shots holding a sword, and one in first person with an empty hand.

Testing

  • Compiles on all 8 versions. I checked the mixin target signatures against each version's classes.
  • Held items: checked by hand in game.
  • First-person fix: tested in the gametest on 1.21.11. With hold playing, the first-person arm was bent without the fix and straight with it.

🤖 Generated with Claude Code

## Held items Items were drawn at the hand of the unbent arm. `PlayerModelMixin` hooks the end of `PlayerModel.translateToHand` and adds one more rigid transform (`BendTransforms.attachAt`). It's the same move the ring at the hand makes, so the item stays in the fist and turns with the forearm, the way the end of the sleeve does. The hook is on `PlayerModel` because it overrides `translateToHand` (to handle slim arms) and never calls `HumanoidModel`'s version. This needed two Stonecutter branches: - the class moved to `model.player` in 1.21.11 - the method gained a render-state parameter in 1.21.9 ## First-person arm The first-person arm is drawn from the same shared model without calling `setupAnim`, so it kept whatever bend the last third-person player drawn had left. `FirstPersonHandMixin` clears it in `renderHand`. ## Tester - A new `hold` animation (arm forward, forearm folded up). - The gametest now takes shots holding a sword, and one in first person with an empty hand. ## Testing - Compiles on all 8 versions. I checked the mixin target signatures against each version's classes. - **Held items:** checked by hand in game. - **First-person fix:** tested in the gametest on 1.21.11. With `hold` playing, the first-person arm was bent without the fix and straight with it. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
selimaj-dev added 1 commit 2026-09-26 18:31:03 +00:00
- PlayerModelMixin: after translateToHand, move the item from the hand of
  the straight arm to the hand of the bent one (BendTransforms.attachAt,
  the same rigid move as the ring at the hand). PlayerModel overrides
  translateToHand for slim arms without calling HumanoidModel's, so the
  hook has to be on PlayerModel.
- FirstPersonHandMixin: the first-person arm is drawn from the shared
  model without setupAnim, so clear any bend left by the last
  third-person player.
- LimbBend.start()/end() getters.
- testmod: a hold animation, and gametest shots holding a sword and in
  first person.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
selimaj-dev merged commit cf05623c54 into master 2026-09-26 18:31:22 +00:00
selimaj-dev deleted branch held-items 2026-09-26 18:31:24 +00:00
Sign in to join this conversation.