[GH-ISSUE #4215] Spawner previews stay empty or stale after /data block edits #1238

Closed
opened 2026-11-02 15:45:19 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @abduvaliy-engineer on GitHub (Oct 30, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4215

Originally assigned to: @abduvaliy-engineer on GitHub.

🤖 Filed by abduvaliy-engineer’s AI agent (OpenAI Codex), not by abduvaliy-engineer personally.

A spawner configured or changed with /data merge block ... {SpawnData:{entity:{id:"minecraft:zombie"}}} stays empty or keeps the previous miniature mob on the client. Reproduced on nightly-2026-10-30 (df583d3, after #3230), using the normal integrated-server path.

Diagnostic logging confirms the server has the requested zombie/pig SpawnData, while the client still holds a default spawner without SpawnData. commands/data.rs::set_data_of replaces the block entity but only calls world.set with the unchanged block state. That does not mark the chunk modified or add the position to the network block-change log, so BlockEntityData is not sent.

Correction to the initial diagnosis: spawner_geometry is already called by Game::mob_geometry; an extra render-pass invocation is not needed. #3230's rendering works when the client receives the correct mob data. The remaining bug is synchronization after NBT edits.

Vanilla reference: Java Edition 26.3 BlockDataAccessor.setData calls BlockEntity.setChanged and Level.sendBlockUpdated(..., 3) after loading the NBT. The fix should use Horizon's existing mark_block_entity_updated helper and verify that the displayed mob changes from zombie to pig and back in an isolated screenshot regression.

The original report was an empty regular spawner on v0.2.97. This follow-up addresses stale previews after command edits in newer builds, not #3043’s separate trial-spawner initialization issue.

Originally created by @abduvaliy-engineer on GitHub (Oct 30, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/4215 Originally assigned to: @abduvaliy-engineer on GitHub. > 🤖 Filed by abduvaliy-engineer’s AI agent (OpenAI Codex), not by abduvaliy-engineer personally. A spawner configured or changed with `/data merge block ... {SpawnData:{entity:{id:"minecraft:zombie"}}}` stays empty or keeps the previous miniature mob on the client. Reproduced on `nightly-2026-10-30` (`df583d3`, after #3230), using the normal integrated-server path. Diagnostic logging confirms the server has the requested zombie/pig `SpawnData`, while the client still holds a default spawner without `SpawnData`. `commands/data.rs::set_data_of` replaces the block entity but only calls `world.set` with the unchanged block state. That does not mark the chunk modified or add the position to the network block-change log, so `BlockEntityData` is not sent. Correction to the initial diagnosis: `spawner_geometry` is already called by `Game::mob_geometry`; an extra render-pass invocation is not needed. #3230's rendering works when the client receives the correct mob data. The remaining bug is synchronization after NBT edits. Vanilla reference: Java Edition 26.3 `BlockDataAccessor.setData` calls `BlockEntity.setChanged` and `Level.sendBlockUpdated(..., 3)` after loading the NBT. The fix should use Horizon's existing `mark_block_entity_updated` helper and verify that the displayed mob changes from zombie to pig and back in an isolated screenshot regression. The original report was an empty regular spawner on v0.2.97. This follow-up addresses stale previews after command edits in newer builds, not #3043’s separate trial-spawner initialization issue.
Author
Owner

@abduvaliy-engineer commented on GitHub (Oct 30, 2026):

🤖 Agent: abduvaliy-engineer’s AI agent (OpenAI Codex) is taking this rendering fix.

/claim

<!-- gh-comment-id:6516658381 --> @abduvaliy-engineer commented on GitHub (Oct 30, 2026): 🤖 Agent: abduvaliy-engineer’s AI agent (OpenAI Codex) is taking this rendering fix. /claim
Author
Owner

@abduvaliy-engineer commented on GitHub (Oct 30, 2026):

/claim

<!-- gh-comment-id:6516742766 --> @abduvaliy-engineer commented on GitHub (Oct 30, 2026): /claim
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#1238
No description provided.