[PR #7844] Every living entity's box and eye height follow minecraft:scale #7859

Open
opened 2026-11-03 07:25:36 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7844
Author: @MSedgeMC
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/scale-dims


📝 Commits (4)

  • df52bce fix: scale every living entity's box and eye height by minecraft:scale
  • 507a23f test: a cow's 0.9 x 1.4 box at minecraft:scale 2 is 1.8 x 2.8
  • 48474b4 port_map: LivingEntity.getDimensions and getScale rows
  • dc219db Format the scale dimensions change

📊 Changes

7 files changed (+138 additions, -41 deletions)

View changed files

📝 crates/horizon-client/src/game/remote.rs (+4 -3)
📝 crates/horizon-client/src/mobs.rs (+4 -3)
📝 crates/horizon-client/src/mobs/living.rs (+117 -9)
📝 crates/horizon-client/src/mobs/render.rs (+1 -6)
📝 crates/horizon-client/src/mobs/riders.rs (+8 -13)
📝 crates/horizon-client/src/shadows.rs (+1 -6)
📝 tools/port_map/game-006.tsv (+3 -1)

📄 Description

LivingEntity.getDimensions is, from the 26.3 jar:

public final EntityDimensions getDimensions(Pose pose) {
    return pose == Pose.SLEEPING ? SLEEPING_DIMENSIONS
         : this.getDefaultDimensions(pose).scale(this.getScale());
}

so minecraft:scale sizes every living entity's box, not only a player's or mannequin's. The bytecode of the two methods:

getDimensions: getstatic Pose.SLEEPING / if_acmpne 13
               getstatic SLEEPING_DIMENSIONS                       (0.2 x 0.2 x 0.2)
               getDefaultDimensions(Pose)                         (type dims x getAgeScale)
               getScale() -> EntityDimensions.scale(F)            (width*F, height*F, eyeHeight*F)
getScale:      getAttributes(); ifnull -> 1.0
               getValue(Attributes.SCALE) -> (float) -> sanitizeScale(F)
Attributes.SCALE: RangedAttribute("attribute.name.scale", 1.0, 0.0625, 16.0), syncable, NEUTRAL
sanitizeScale:   LivingEntity 1:1; Shulker min(scale, 3); HappyGhast min(scale, 1); EnderDragon 1.0
Entity.getEyeHeight(Pose): getDimensions(pose).eyeHeight()

Horizon applied that scale only in the avatar branch of mobs/living.rs::awake_dims_in, so a cow, zombie or any other mob with a minecraft:scale attribute kept its type's box while shadows.rs already scaled its shadow radius and remote_mob_attributes already stored the value on any living entity. A datapack's 2x zombie was 1.95 tall to the hitbox raycast, the attack range, the name tag, the leash pins and its own seat.

Mob::model_scale is now the single port of getScale (attribute, 0 = unset = 1, then the two caps), awake_dims_in multiplies width, height and eye height by it after the baby/species/size dims, and dims() still answers a sleeper with 0.2 before the scale. riders::base_attachment had divided the scale back out of height() for avatars only because theirs was the only box that carried it; every box does now. The shadow radius, the attachments and the avatar model scale read the one helper.

Values (a cow is EntityType.COW = sized(0.9f, 1.4f).eyeHeight(1.3f)):

minecraft:scale box eye height Mob::bounds
1 (unset) 0.9 x 1.4 1.3 -0.45..0.45, 0..1.4
2 1.8 x 2.8 2.6 -0.9..0.9, 0..2.8
0.0625 (attribute floor) 0.05625 x 0.0875 0.08125

Without the fix the scale-2 case reads 0.8999999761581421 x 1.399999976158142 x 1.2999999523162842, and the shulker case reads a scale of 1.0 where vanilla caps 4 at 3.

Tests: cargo test -q -p horizon-client-lib --lib mobs::living::tests::a_ (three new tests), the whole horizon-client-lib lib suite and cargo clippy -q -p horizon-client-lib --lib --all-targets -- -D warnings pass locally; python3 tools/port_ledger.py check needs a ledger this checkout cannot build (python3 tools/port_ledger.py build reads the game jar, absent here), so the port_map rows were edited by hand.

Not in this PR: LivingEntityRenderer.submit scales the model by LivingEntityRenderState.scale
(getScale()) for every living entity too, while mobs/render.rs::species_scale applies the
attribute to avatars only. A scaled cow's model was the type's own size before this change and still
is; that is the renderer's method, so it belongs in its own change rather than this one.


🔄 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/7844 **Author:** [@MSedgeMC](https://github.com/MSedgeMC) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/scale-dims` --- ### 📝 Commits (4) - [`df52bce`](https://github.com/horizon-rust/horizon/commit/df52bce5c743cbe5a966392e5a241a1def278376) fix: scale every living entity's box and eye height by minecraft:scale - [`507a23f`](https://github.com/horizon-rust/horizon/commit/507a23ff4a88e63af50678bf4901dd9cae305894) test: a cow's 0.9 x 1.4 box at minecraft:scale 2 is 1.8 x 2.8 - [`48474b4`](https://github.com/horizon-rust/horizon/commit/48474b4c59e1b03c57048b90277e36ea1d8f61a0) port_map: LivingEntity.getDimensions and getScale rows - [`dc219db`](https://github.com/horizon-rust/horizon/commit/dc219db8449aac69a89ac71c409144dfe137fcd2) Format the scale dimensions change ### 📊 Changes **7 files changed** (+138 additions, -41 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/remote.rs` (+4 -3) 📝 `crates/horizon-client/src/mobs.rs` (+4 -3) 📝 `crates/horizon-client/src/mobs/living.rs` (+117 -9) 📝 `crates/horizon-client/src/mobs/render.rs` (+1 -6) 📝 `crates/horizon-client/src/mobs/riders.rs` (+8 -13) 📝 `crates/horizon-client/src/shadows.rs` (+1 -6) 📝 `tools/port_map/game-006.tsv` (+3 -1) </details> ### 📄 Description `LivingEntity.getDimensions` is, from the 26.3 jar: public final EntityDimensions getDimensions(Pose pose) { return pose == Pose.SLEEPING ? SLEEPING_DIMENSIONS : this.getDefaultDimensions(pose).scale(this.getScale()); } so `minecraft:scale` sizes **every** living entity's box, not only a player's or mannequin's. The bytecode of the two methods: getDimensions: getstatic Pose.SLEEPING / if_acmpne 13 getstatic SLEEPING_DIMENSIONS (0.2 x 0.2 x 0.2) getDefaultDimensions(Pose) (type dims x getAgeScale) getScale() -> EntityDimensions.scale(F) (width*F, height*F, eyeHeight*F) getScale: getAttributes(); ifnull -> 1.0 getValue(Attributes.SCALE) -> (float) -> sanitizeScale(F) Attributes.SCALE: RangedAttribute("attribute.name.scale", 1.0, 0.0625, 16.0), syncable, NEUTRAL sanitizeScale: LivingEntity 1:1; Shulker min(scale, 3); HappyGhast min(scale, 1); EnderDragon 1.0 Entity.getEyeHeight(Pose): getDimensions(pose).eyeHeight() Horizon applied that scale only in the avatar branch of `mobs/living.rs::awake_dims_in`, so a cow, zombie or any other mob with a `minecraft:scale` attribute kept its type's box while `shadows.rs` already scaled its shadow radius and `remote_mob_attributes` already stored the value on any living entity. A datapack's 2x zombie was 1.95 tall to the hitbox raycast, the attack range, the name tag, the leash pins and its own seat. `Mob::model_scale` is now the single port of `getScale` (attribute, 0 = unset = 1, then the two caps), `awake_dims_in` multiplies width, height and eye height by it after the baby/species/size dims, and `dims()` still answers a sleeper with 0.2 before the scale. `riders::base_attachment` had divided the scale back out of `height()` for avatars only because theirs was the only box that carried it; every box does now. The shadow radius, the attachments and the avatar model scale read the one helper. Values (a cow is `EntityType.COW` = `sized(0.9f, 1.4f).eyeHeight(1.3f)`): | `minecraft:scale` | box | eye height | `Mob::bounds` | |---|---|---|---| | 1 (unset) | 0.9 x 1.4 | 1.3 | -0.45..0.45, 0..1.4 | | 2 | 1.8 x 2.8 | 2.6 | -0.9..0.9, 0..2.8 | | 0.0625 (attribute floor) | 0.05625 x 0.0875 | 0.08125 | | Without the fix the scale-2 case reads `0.8999999761581421 x 1.399999976158142 x 1.2999999523162842`, and the shulker case reads a scale of 1.0 where vanilla caps 4 at 3. Tests: `cargo test -q -p horizon-client-lib --lib mobs::living::tests::a_` (three new tests), the whole `horizon-client-lib` lib suite and `cargo clippy -q -p horizon-client-lib --lib --all-targets -- -D warnings` pass locally; `python3 tools/port_ledger.py check` needs a ledger this checkout cannot build (`python3 tools/port_ledger.py build` reads the game jar, absent here), so the port_map rows were edited by hand. Not in this PR: `LivingEntityRenderer.submit` scales the model by `LivingEntityRenderState.scale` (`getScale()`) for every living entity too, while `mobs/render.rs::species_scale` applies the attribute to avatars only. A scaled cow's model was the type's own size before this change and still is; that is the renderer's method, so it belongs in its own change rather than this one. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7859
No description provided.