[PR #7131] [MERGED] Armor stands honour NoGravity: no fall, no plates, no catching fire #7364

Closed
opened 2026-11-03 06:38:22 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7131
Author: @HrafnaValkyrja
Created: 11/2/2026
Status: ✅ Merged
Merged: 11/2/2026
Merged by: @ludovic111

Base: main ← Head: fix/armor-stand-no-gravity


📝 Commits (2)

  • a2306df Armor stands keep NoGravity: no fall, no plates, no fire
  • 161e81b Merge remote-tracking branch 'origin/main' into fix/armor-stand-no-gravity

📊 Changes

3 files changed (+101 additions, -1 deletions)

View changed files

📝 crates/horizon-client/src/entities.rs (+42 -1)
📝 crates/horizon-client/src/entity_nbt.rs (+33 -0)
📝 crates/horizon-client/src/game/entity.rs (+26 -0)

📄 Description

🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself.

What and why

An armor stand summoned (or loaded) with NoGravity:1b fell in Horizon and stayed put in vanilla, and one resting in a pressure plate powered it where vanilla's does not. Cause: ArmorStand had no NoGravity flag, so the reader dropped it and the stand always took gravity (ArmorStand::tick) and was always swept for the blocks it stands in (sweeps_blocks_inside). The stand now keeps the flag (read from NBT, written back only when set, cleared by data merge ... {NoGravity:0b}), does not travel while it is set, is not swept for plates, and is not lit by a fire block.

Fixes #7128

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Read through tools/rea_vanilla.py: ArmorStand.hasPhysics() is !(isMarker() || isNoGravity()); ArmorStand.travel returns at once without it; isEffectiveAi also needs it; isIgnoringBlockTriggers is isMarker() only. Entity.applyEffectsFromBlocks / checkInsideBlocks read in bytecode do not by themselves explain why a NoGravity stand is never swept, so the plate and fire behaviour is taken from the measurement below, not from a method I could point at: a NoGravity stand did not power a plate (stone or oak, placed before or after it), did not catch fire in a fire block, and did both once NoGravity was set to 0b.

Proof

Side-by-side against the real 26.3 server (dedicated servers, flat world, no player, 8 ticks, tolerance 1e-6), three scenes:

scene what Horizon before Horizon after
standgrav stone and oak plate, stands with NoGravity at feet y 103, 101, 100, small at 101, and a gravity stand at 100 136 of 270 match 270 of 270
standgrav2 oak plate: NoGravity with Motion -0.5, plate placed 2 ticks late, NoGravity cleared after 2 ticks, gravity stand, marker 109 of 147 147 of 147
standgrav3 stand in a fire block: NoGravity, normal, marker 30 of 45 37 of 45

Tick by tick, stand 3 blocks up (y / Motion.y): vanilla 103.0 / 0.0 at ticks 1, 2, 4, 8. Before: 103.0 / -0.0784, 102.9216 / -0.1552, 102.5358 / -0.3043, 100.8904 / -0.5850. After: 103.0 / 0.0 at every tick. Stand at feet y 100.0 in a stone plate: plate powered false at every tick in vanilla, true from tick 1 before, false after. Control (stand without NoGravity) powers the plate in all three.

The 8 values still different in standgrav3 are the normal stand in fire (vanilla Fire 160 and Health 19.85 on tick 1, Horizon Fire 100 and Health 20.0); that was already different on main, with or without NoGravity, and is not touched here.

Not changed: placing the stand from its item does not read the item's entity_data, so no item can place a NoGravity stand in Horizon yet; that is the same on main.

Test

Three tests, each fails with the fix reverted and passes with it: armor_stand_keeps_no_gravity_through_a_save (flag read from summon NBT, written only when set, cleared again), a_no_gravity_stand_stays_put (five ticks with Pos and Motion unchanged, gravity back once cleared; skips when the prepared resources are missing, like the neighbouring stand tests), a_no_gravity_stand_is_not_swept_for_the_blocks_it_is_in.

Harnesses

Run with DISPLAY=:0 HORIZON_E2E_HEADLESS=1, python3 tools/parity.py --fresh ...: armor_stand_frost, armor_stand_turtle_egg, redstone (plates), dispenser, server_entities, entity_model all pass. mace fails with 2981 of 3000 cases matching, 3 of them "mace smash with wind burst on an armor stand"; it fails with the same numbers (2981 of 3000, 3 stand cases) with this change taken out, so it is not from this change and is not touched here. pr_ready --quick: public tree, Python tests, rustfmt, clippy, unit tests and mod API all pass.

Overlap

Related, not duplicate: #7037 moves NoGravity into the entity trait and says armor stands are not covered; this adds the stand's own flag and does not touch that trait.

Proved by script against the real 26.3 server; no human played this change.

Other projects' code

none

Self-check

pr_ready (tools/pr_ready.py --quick on Valhalla, against origin/main at 9051bac55, 5 min 49 s)

Check Result
Scope ✅ 3 files, +101 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 612 passed (44 s)
rustfmt ✅ (10 s)
Rust ⚠️ 1.98.0 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with rustup update
clippy ✅ (2 min 26 s)
tests: horizon-client, horizon-client-lib ✅ 2088 passed (2 min 9 s)
doc tests ✅ 0 passed (3 s)
content root tests ➖ content root untouched
mod API up to date ✅ (16 s)
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

🤖 Generated with Claude Code

https://claude.ai/code/session_018zuDTsnyHkP28bzn3u7S3m


🔄 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/7131 **Author:** [@HrafnaValkyrja](https://github.com/HrafnaValkyrja) **Created:** 11/2/2026 **Status:** ✅ Merged **Merged:** 11/2/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/armor-stand-no-gravity` --- ### 📝 Commits (2) - [`a2306df`](https://github.com/horizon-rust/horizon/commit/a2306dfee02374321fe7633940f2a52732cc757c) Armor stands keep NoGravity: no fall, no plates, no fire - [`161e81b`](https://github.com/horizon-rust/horizon/commit/161e81b0bf53afc21fb586f4e90a1b7a61bad739) Merge remote-tracking branch 'origin/main' into fix/armor-stand-no-gravity ### 📊 Changes **3 files changed** (+101 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entities.rs` (+42 -1) 📝 `crates/horizon-client/src/entity_nbt.rs` (+33 -0) 📝 `crates/horizon-client/src/game/entity.rs` (+26 -0) </details> ### 📄 Description > 🤖 Opened by Valkyrie's AI agent (Claude Code, Opus 5.5), not by Valkyrie herself. ## What and why An armor stand summoned (or loaded) with `NoGravity:1b` fell in Horizon and stayed put in vanilla, and one resting in a pressure plate powered it where vanilla's does not. Cause: `ArmorStand` had no `NoGravity` flag, so the reader dropped it and the stand always took gravity (`ArmorStand::tick`) and was always swept for the blocks it stands in (`sweeps_blocks_inside`). The stand now keeps the flag (read from NBT, written back only when set, cleared by `data merge ... {NoGravity:0b}`), does not travel while it is set, is not swept for plates, and is not lit by a fire block. Fixes #7128 ## Kind - [x] parity: Horizon now does what vanilla 26.3 does - [ ] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Read through `tools/rea_vanilla.py`: `ArmorStand.hasPhysics()` is `!(isMarker() || isNoGravity())`; `ArmorStand.travel` returns at once without it; `isEffectiveAi` also needs it; `isIgnoringBlockTriggers` is `isMarker()` only. `Entity.applyEffectsFromBlocks` / `checkInsideBlocks` read in bytecode do not by themselves explain why a `NoGravity` stand is never swept, so the plate and fire behaviour is taken from the measurement below, not from a method I could point at: a `NoGravity` stand did not power a plate (stone or oak, placed before or after it), did not catch fire in a fire block, and did both once `NoGravity` was set to 0b. ## Proof Side-by-side against the real 26.3 server (dedicated servers, flat world, no player, 8 ticks, tolerance 1e-6), three scenes: | scene | what | Horizon before | Horizon after | |---|---|---|---| | standgrav | stone and oak plate, stands with `NoGravity` at feet y 103, 101, 100, small at 101, and a gravity stand at 100 | 136 of 270 match | 270 of 270 | | standgrav2 | oak plate: `NoGravity` with Motion -0.5, plate placed 2 ticks late, `NoGravity` cleared after 2 ticks, gravity stand, marker | 109 of 147 | 147 of 147 | | standgrav3 | stand in a fire block: `NoGravity`, normal, marker | 30 of 45 | 37 of 45 | Tick by tick, stand 3 blocks up (y / Motion.y): vanilla 103.0 / 0.0 at ticks 1, 2, 4, 8. Before: 103.0 / -0.0784, 102.9216 / -0.1552, 102.5358 / -0.3043, 100.8904 / -0.5850. After: 103.0 / 0.0 at every tick. Stand at feet y 100.0 in a stone plate: plate powered false at every tick in vanilla, true from tick 1 before, false after. Control (stand without `NoGravity`) powers the plate in all three. The 8 values still different in standgrav3 are the normal stand in fire (vanilla Fire 160 and Health 19.85 on tick 1, Horizon Fire 100 and Health 20.0); that was already different on main, with or without `NoGravity`, and is not touched here. Not changed: placing the stand from its item does not read the item's `entity_data`, so no item can place a `NoGravity` stand in Horizon yet; that is the same on main. ## Test Three tests, each fails with the fix reverted and passes with it: `armor_stand_keeps_no_gravity_through_a_save` (flag read from summon NBT, written only when set, cleared again), `a_no_gravity_stand_stays_put` (five ticks with Pos and Motion unchanged, gravity back once cleared; skips when the prepared resources are missing, like the neighbouring stand tests), `a_no_gravity_stand_is_not_swept_for_the_blocks_it_is_in`. ## Harnesses Run with `DISPLAY=:0 HORIZON_E2E_HEADLESS=1`, `python3 tools/parity.py --fresh ...`: `armor_stand_frost`, `armor_stand_turtle_egg`, `redstone` (plates), `dispenser`, `server_entities`, `entity_model` all pass. `mace` fails with 2981 of 3000 cases matching, 3 of them "mace smash with wind burst on an armor stand"; it fails with the same numbers (2981 of 3000, 3 stand cases) with this change taken out, so it is not from this change and is not touched here. `pr_ready --quick`: public tree, Python tests, rustfmt, clippy, unit tests and mod API all pass. ## Overlap Related, not duplicate: #7037 moves `NoGravity` into the entity trait and says armor stands are not covered; this adds the stand's own flag and does not touch that trait. Proved by script against the real 26.3 server; no human played this change. ## Other projects' code none ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on Valhalla, against origin/main at 9051bac55, 5 min 49 s) | Check | Result | | --- | --- | | Scope | ✅ 3 files, +101 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 612 passed (44 s) | | rustfmt | ✅ (10 s) | | Rust | ⚠️ 1.98.0 is older than CI's stable (1.99): clippy may flag lints CI doesn't, update with `rustup update` | | clippy | ✅ (2 min 26 s) | | tests: horizon-client, horizon-client-lib | ✅ 2088 passed (2 min 9 s) | | doc tests | ✅ 0 passed (3 s) | | content root tests | ➖ content root untouched | | mod API up to date | ✅ (16 s) | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_018zuDTsnyHkP28bzn3u7S3m --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:38:22 +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#7364
No description provided.