[GH-ISSUE #6353] Primed TNT: /tag add and /tag remove report success but write nothing #2058

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

Originally created by @CocofireHD on GitHub (Nov 1, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6353

Originally assigned to: @CocofireHD on GitHub.

Version: nightly 2026-11-01 · main 62bdd29b2 · What I did: summoned a primed TNT with a long fuse and a seed tag (summon minecraft:tnt ~ ~2 ~ {Tags:["seeded"],fuse:1200s}), then tag @e[type=minecraft:tnt,limit=1] add boom and tag … list. What happened: both /tag add and /tag remove print success and change nothing — the listing still shows only the seeded tag. What I expected: the added tag is on the entity and the removed one is gone, as in vanilla.

Measured in a real build (cargo build --profile fast -p horizon-client, creative world, horizon-ctl):

command answer tag list after
tag @e[type=minecraft:tnt,limit=1] list Primed TNT has 1 tag(s): seeded —
tag @e[type=minecraft:tnt,limit=1] add boom Added tag 'boom' to Primed TNT Primed TNT has 1 tag(s): seeded
tag @e[type=minecraft:tnt,limit=1] remove seeded Removed tag 'seeded' from Primed TNT Primed TNT has 1 tag(s): seeded

Cause: the read and the write path disagree about which targets own a persisted compound.

  • crates/horizon-client/src/game/scoreboard.rs tags_of reads Target::Tnt(id) from persist.raw:

    Target::Mob(id) | Target::Item(id) | Target::Stand(id) | Target::Frame(id)
    | Target::Painting(id) | Target::Boat(id) | Target::Cart(id)
    | Target::Tnt(id) | Target::Other(id) => self.persist.raw.get(&id),
    
  • crates/horizon-client/src/game/commands/data.rs raw_mut — the only writer, reached from set_entity_tags — has no Target::Tnt arm, so it falls through to _ => None and set_entity_tags returns without touching anything:

    Target::Mob(id) | Target::Item(id) | Target::Stand(id) | Target::Frame(id)
    | Target::Painting(id) | Target::Boat(id) | Target::Cart(id)
    | Target::Other(id) => Some(self.persist.raw.entry(id).or_insert_with(empty)),
    _ => None,
    

tags_of lists eight kinds, raw_mut seven. Vanilla has no such split: TagCommand writes through Entity.addTag, which every entity type has, primed TNT included.

Expected fix: add Target::Tnt(id) to raw_mut's persist.raw arm, so /tag on a primed TNT reads and writes the same compound.

🤖 Filed by CocofireHD's AI agent (Hermes Agent, deepseek-v4.1-flash), not by CocofireHD personally.

Originally created by @CocofireHD on GitHub (Nov 1, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/6353 Originally assigned to: @CocofireHD on GitHub. **Version:** nightly 2026-11-01 · `main 62bdd29b2` · **What I did:** summoned a primed TNT with a long fuse and a seed tag (`summon minecraft:tnt ~ ~2 ~ {Tags:["seeded"],fuse:1200s}`), then `tag @e[type=minecraft:tnt,limit=1] add boom` and `tag … list`. **What happened:** both `/tag add` and `/tag remove` print success and change nothing — the listing still shows only the seeded tag. **What I expected:** the added tag is on the entity and the removed one is gone, as in vanilla. Measured in a real build (`cargo build --profile fast -p horizon-client`, creative world, `horizon-ctl`): | command | answer | tag list after | |---|---|---| | `tag @e[type=minecraft:tnt,limit=1] list` | `Primed TNT has 1 tag(s): seeded` | — | | `tag @e[type=minecraft:tnt,limit=1] add boom` | `Added tag 'boom' to Primed TNT` | `Primed TNT has 1 tag(s): seeded` | | `tag @e[type=minecraft:tnt,limit=1] remove seeded` | `Removed tag 'seeded' from Primed TNT` | `Primed TNT has 1 tag(s): seeded` | **Cause:** the read and the write path disagree about which targets own a persisted compound. - `crates/horizon-client/src/game/scoreboard.rs` `tags_of` reads `Target::Tnt(id)` from `persist.raw`: ```rust Target::Mob(id) | Target::Item(id) | Target::Stand(id) | Target::Frame(id) | Target::Painting(id) | Target::Boat(id) | Target::Cart(id) | Target::Tnt(id) | Target::Other(id) => self.persist.raw.get(&id), ``` - `crates/horizon-client/src/game/commands/data.rs` `raw_mut` — the only writer, reached from `set_entity_tags` — has no `Target::Tnt` arm, so it falls through to `_ => None` and `set_entity_tags` returns without touching anything: ```rust Target::Mob(id) | Target::Item(id) | Target::Stand(id) | Target::Frame(id) | Target::Painting(id) | Target::Boat(id) | Target::Cart(id) | Target::Other(id) => Some(self.persist.raw.entry(id).or_insert_with(empty)), _ => None, ``` `tags_of` lists eight kinds, `raw_mut` seven. Vanilla has no such split: `TagCommand` writes through `Entity.addTag`, which every entity type has, primed TNT included. **Expected fix:** add `Target::Tnt(id)` to `raw_mut`'s `persist.raw` arm, so `/tag` on a primed TNT reads and writes the same compound. 🤖 Filed by CocofireHD's AI agent (Hermes Agent, deepseek-v4.1-flash), not by CocofireHD personally.
Author
Owner

@CocofireHD commented on GitHub (Nov 1, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6562919911 --> @CocofireHD commented on GitHub (Nov 1, 2026): 🤖 Agent: /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#2058
No description provided.