fix: rotate held sprites on the rightitem bone #43

Merged
smell-of-curry merged 1 commit from hotfix/fossil-holder-pose into main 2026-10-28 18:25:42 +00:00

Cause

animation.item_holder.idle writes pokeb:item_holder_rot_* onto bone root and pokeb:item_holder_scale onto the same bone. The held sprite attaches to rightitem (geometry rest [18, -11.8073, -9.5562]). Scale on root inherits. Rotation on root does not turn the sprite, which is why the fossil cleaner icon stayed upright after beh PR #815.

There is no custom render controller. controller.render.default draws the empty geometry; enable_attachables draws the item on rightitem.

Fix

animation.item_holder.held_bone writes pokeb:item_holder_item_rot_* straight onto rightitem. The client plays it only when one component is non-zero. Default 0 leaves the geometry rest pose, so potion and crate holders (they only set the root properties) stay as they are.

Beh branch hotfix/fossil-flat-pose sets those properties to [-90, 0, 0] for the fossil cleaner.

Do not release this commit. The message does not start with v.

Test

Needs an in-game look together with the beh branch. The go-test-bds viewer does not match Bedrock held-item rendering.

## Cause `animation.item_holder.idle` writes `pokeb:item_holder_rot_*` onto bone `root` and `pokeb:item_holder_scale` onto the same bone. The held sprite attaches to `rightitem` (geometry rest `[18, -11.8073, -9.5562]`). Scale on `root` inherits. Rotation on `root` does not turn the sprite, which is why the fossil cleaner icon stayed upright after beh PR #815. There is no custom render controller. `controller.render.default` draws the empty geometry; `enable_attachables` draws the item on `rightitem`. ## Fix `animation.item_holder.held_bone` writes `pokeb:item_holder_item_rot_*` straight onto `rightitem`. The client plays it only when one component is non-zero. Default 0 leaves the geometry rest pose, so potion and crate holders (they only set the root properties) stay as they are. Beh branch `hotfix/fossil-flat-pose` sets those properties to `[-90, 0, 0]` for the fossil cleaner. Do not release this commit. The message does not start with `v`. ## Test Needs an in-game look together with the beh branch. The go-test-bds viewer does not match Bedrock held-item rendering.
fix: drive item-holder rightitem rotation from its own properties
All checks were successful
Auto Assign / run (pull_request_target) Successful in 2s
CI / build-and-test (20.x) (pull_request) Successful in 1m12s
Model Preview / model-preview (pull_request) Successful in 2m49s
bdb8305792
Held sprites ignore root bone rotation. The override stays off while those properties are zero, so potion and crate mounts keep the geometry rest pose.

Co-authored-by: Cursor <cursoragent@cursor.com>
smell-of-curry was assigned by forgejo-actions 2026-10-28 18:19:12 +00:00
bot left a comment

Desk review at bdb83057. No blockers. The diff is small and matches the beh branch hotfix/fossil-flat-pose (171a8d0), which defines pokeb:item_holder_item_rot_x/y/z as float, range [-360, 360], default 0, client_sync: true.

Should-check

  • Merge order. This pack queries pokeb:item_holder_item_rot_* on every item holder. If res ships before the beh change is live, the client is querying properties the entity doesn't define, which tends to spam the content log. Ship them together, or beh first.
  • Additive vs absolute. Bedrock adds animation bone rotation on top of the geometry rest rotation, which is why 0 leaves the rest pose. But the beh doc on fossilCleanerDisplay() calls [-90, 0, 0] the "absolute rightitem euler". In-game, the fossil will sit at rest [18, -11.8073, -9.5562] plus [-90, 0, 0], not at exactly [-90, 0, 0]. If it looks slightly tilted, subtract the rest pose on the beh side (or fix the doc wording if additive was intended).

Nits

  • The held_bone gate in entity/item_holder.json isn't needed for correctness, since an all-zero rotation is a no-op. It's fine to keep it to skip the animation for potion and crate holders, but a short comment saying that's why would help the next reader.

No open issues in this repo to link. In-game check with the beh branch is still the real test, as the PR body says.

Desk review at bdb83057. No blockers. The diff is small and matches the beh branch `hotfix/fossil-flat-pose` (171a8d0), which defines `pokeb:item_holder_item_rot_x/y/z` as float, range [-360, 360], default 0, `client_sync: true`. **Should-check** - Merge order. This pack queries `pokeb:item_holder_item_rot_*` on every item holder. If res ships before the beh change is live, the client is querying properties the entity doesn't define, which tends to spam the content log. Ship them together, or beh first. - Additive vs absolute. Bedrock adds animation bone rotation on top of the geometry rest rotation, which is why 0 leaves the rest pose. But the beh doc on `fossilCleanerDisplay()` calls `[-90, 0, 0]` the "absolute `rightitem` euler". In-game, the fossil will sit at rest `[18, -11.8073, -9.5562]` plus `[-90, 0, 0]`, not at exactly `[-90, 0, 0]`. If it looks slightly tilted, subtract the rest pose on the beh side (or fix the doc wording if additive was intended). **Nits** - The `held_bone` gate in `entity/item_holder.json` isn't needed for correctness, since an all-zero rotation is a no-op. It's fine to keep it to skip the animation for potion and crate holders, but a short comment saying that's why would help the next reader. No open issues in this repo to link. In-game check with the beh branch is still the real test, as the PR body says.

Minecraft Model Preview (bdb8305)

Model Changes

Entity Before After
No renderable model changes detected
## Minecraft Model Preview (bdb8305) ### Model Changes | Entity | Before | After | |--------|--------|-------| | _No renderable model changes detected_ | | |
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
3 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pokebedrock/pokebedrock-res!43
No description provided.