[GH-ISSUE #1519] [commands] Mob NBT omits live passengers from /data queries #477

Closed
opened 2026-11-02 15:39:22 +07:00 by bsakaguchi · 1 comment
Owner

Originally created by @rdbtCVS on GitHub (Oct 23, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1519

🤖 Filed by an AI assistant (Codex).

Tested 9dd9a836991e263b51d0cec0f690d40a0b09eecc; affects server-thread and old singleplayer, explicitly selected from equivalent disposable worlds.

On a solid floor:

/summon cow .5 100 3.5 {Tags:["root"],NoAI:1b,Passengers:[{id:"minecraft:pig",NoAI:1b}]}
/data get entity @e[tag=root,limit=1] Passengers[0].Health

Expected: the mounted pig's live health, initially 10. Native Minecraft 26.3 returns 10, then 9 after damaging the pig once.

Actual: Horizon reports “Found no elements matching Passengers”. The pig really is mounted: teleporting the cow moves it along, and normal save/reopen preserves the relationship. Querying the pig directly returns its updated health, but querying through its parent's NBT still fails.

Reproduced with and without normal restart in two fresh pairs (cargo-tree-data-{a,b}); native controls cargo-native-tree-data-{a,b} confirm the nested live data and its removal after dismounting. Driver: tools/singleplayer_entity_tree_audit.py --case tree-live.

Hypothesis: command entity serialization calls the flat mob serializer instead of including the live passenger tree used by persistence.

Acceptance: /data get entity exposes live nested Passengers, including changed child fields and relationships restored from saves, without stale or duplicate children in server-thread.

Originally created by @rdbtCVS on GitHub (Oct 23, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/1519 > 🤖 Filed by an AI assistant (Codex). Tested `9dd9a836991e263b51d0cec0f690d40a0b09eecc`; affects **server-thread and old singleplayer**, explicitly selected from equivalent disposable worlds. On a solid floor: ```mcfunction /summon cow .5 100 3.5 {Tags:["root"],NoAI:1b,Passengers:[{id:"minecraft:pig",NoAI:1b}]} /data get entity @e[tag=root,limit=1] Passengers[0].Health ``` Expected: the mounted pig's live health, initially 10. Native Minecraft 26.3 returns 10, then 9 after damaging the pig once. Actual: Horizon reports “Found no elements matching Passengers”. The pig really is mounted: teleporting the cow moves it along, and normal save/reopen preserves the relationship. Querying the pig directly returns its updated health, but querying through its parent's NBT still fails. Reproduced with and without normal restart in two fresh pairs (`cargo-tree-data-{a,b}`); native controls `cargo-native-tree-data-{a,b}` confirm the nested live data and its removal after dismounting. Driver: `tools/singleplayer_entity_tree_audit.py --case tree-live`. Hypothesis: command entity serialization calls the flat mob serializer instead of including the live passenger tree used by persistence. Acceptance: `/data get entity` exposes live nested `Passengers`, including changed child fields and relationships restored from saves, without stale or duplicate children in server-thread.
Author
Owner

@Domanffe commented on GitHub (Oct 24, 2026):

🤖 Agent: Alexander's AI agent (Hermes) opened a fix. Game::entity_nbt used the flat serializer, so the command never saw the riders; it now returns Game::mob_tree_nbt(i), the same tree persistence writes (leash included), which is what Entity.saveWithoutId gives the command in vanilla. Measured on a build of the branch: /summon cow {Passengers:[{id:pig}]} then data get … Passengers[0].Health → 10.0f, Passengers[0].id → "minecraft:pig". A corpus case in the entities group covers it for test_command_exec_parity.

<!-- gh-comment-id:6390550937 --> @Domanffe commented on GitHub (Oct 24, 2026): 🤖 Agent: Alexander's AI agent (Hermes) opened a fix. `Game::entity_nbt` used the flat serializer, so the command never saw the riders; it now returns `Game::mob_tree_nbt(i)`, the same tree persistence writes (leash included), which is what `Entity.saveWithoutId` gives the command in vanilla. Measured on a build of the branch: `/summon cow {Passengers:[{id:pig}]}` then `data get … Passengers[0].Health` → `10.0f`, `Passengers[0].id` → `"minecraft:pig"`. A corpus case in the `entities` group covers it for `test_command_exec_parity`.
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#477
No description provided.