[PR #3752] [MERGED] Player model: /attribute minecraft:scale scales the model, not only the camera #5195

Closed
opened 2026-11-03 05:10:53 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/3752
Author: @xFedeT
Created: 10/29/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @levzzz5154

Base: main ← Head: fix/player-scale-attribute


📝 Commits (1)

  • 647e7c2 Player model: /attribute minecraft:scale scales the model, not only the camera

📊 Changes

3 files changed (+20 additions, -2 deletions)

View changed files

📝 crates/horizon-client/src/game/perspective.rs (+9 -0)
📝 crates/horizon-client/src/mobs.rs (+3 -0)
📝 crates/horizon-client/src/mobs/render.rs (+8 -2)

📄 Description

🤖 Opened by Federico's AI agent (Claude), not by Federico himself.

Fixes #3746. Also one item of #3684 ("attribute setscale doesn't change the player's scale ... it only moves the camera down"). Checked: no open PR touches the player model's scale.

What and why

LivingEntityRenderer.submit scales the whole pose stack by the entity's scale (LivingEntityRenderState.scale). Horizon scaled the player's eye height and camera distance but drew the model at scale 1: with /attribute @s minecraft:scale base set 2 the camera moved twice as far back and the player looked half its size.

Change

  • game/perspective.rs tick_player_model: the local player's minecraft:scale goes to the model (Extra::model_scale, 0 = unscaled); draw_player_preview clears it, as extractEntityInInventory divides the size by the scale.
  • mobs/render.rs species_scale: the avatar scale 0.9375 is multiplied by it. The cape, elytra, spin attack and held items already build their transform from base_transform, so they follow.
  • mobs.rs: the field.

Vanilla reference

LivingEntityRenderer.submit (poseStack.scale(state.scale, ...)), AvatarRenderer.scale, InventoryScreen.extractEntityInInventory.

Not in this PR

Other players' scale on a server (their attribute is not tracked here), and the box scale of paintings or mobs set with /attribute.

Testing

horizon-ctl with screenshots in third person: scale 1, 2 and 0.5 give the same apparent size of the figure (camera distance and model scale cancel), where before scale 2 looked half size. QA by Federico in game: arms, held items, armour, cape, inventory preview at scales 0.5, 1 and 2: all fine.

pr_ready --quick results follow in a comment. Parity harnesses are left to CI.

🤖 Generated with Claude Code


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/3752 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 10/29/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@levzzz5154](https://github.com/levzzz5154) **Base:** `main` ← **Head:** `fix/player-scale-attribute` --- ### 📝 Commits (1) - [`647e7c2`](https://github.com/horizon-rust/horizon/commit/647e7c2aca5da6244322b20ba29fb1087920ae40) Player model: /attribute minecraft:scale scales the model, not only the camera ### 📊 Changes **3 files changed** (+20 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/perspective.rs` (+9 -0) 📝 `crates/horizon-client/src/mobs.rs` (+3 -0) 📝 `crates/horizon-client/src/mobs/render.rs` (+8 -2) </details> ### 📄 Description > 🤖 Opened by Federico's AI agent (Claude), not by Federico himself. Fixes #3746. Also one item of #3684 ("attribute setscale doesn't change the player's scale ... it only moves the camera down"). Checked: no open PR touches the player model's scale. ## What and why `LivingEntityRenderer.submit` scales the whole pose stack by the entity's scale (`LivingEntityRenderState.scale`). Horizon scaled the player's eye height and camera distance but drew the model at scale 1: with `/attribute @s minecraft:scale base set 2` the camera moved twice as far back and the player looked half its size. ## Change - `game/perspective.rs` `tick_player_model`: the local player's `minecraft:scale` goes to the model (`Extra::model_scale`, 0 = unscaled); `draw_player_preview` clears it, as `extractEntityInInventory` divides the size by the scale. - `mobs/render.rs` `species_scale`: the avatar scale `0.9375` is multiplied by it. The cape, elytra, spin attack and held items already build their transform from `base_transform`, so they follow. - `mobs.rs`: the field. ## Vanilla reference `LivingEntityRenderer.submit` (`poseStack.scale(state.scale, ...)`), `AvatarRenderer.scale`, `InventoryScreen.extractEntityInInventory`. ## Not in this PR Other players' scale on a server (their attribute is not tracked here), and the box scale of paintings or mobs set with `/attribute`. ## Testing `horizon-ctl` with screenshots in third person: scale 1, 2 and 0.5 give the same apparent size of the figure (camera distance and model scale cancel), where before scale 2 looked half size. QA by Federico in game: arms, held items, armour, cape, inventory preview at scales 0.5, 1 and 2: all fine. `pr_ready --quick` results follow in a comment. Parity harnesses are left to CI. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:10:53 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
horizon-rust/horizon#5195
No description provided.