[PR #6288] [MERGED] Players on a server keep their tags: @a[tag=...] and /tag work for guests #6771

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/6288
Author: @xFedeT
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: fix/selector-tag-players


📝 Commits (2)

  • 234a37b Players on a server keep their tags: tag add/remove and @a[tag=...] work for guests
  • 66359b4 Merge main into #6288

📊 Changes

2 files changed (+11 additions, -5 deletions)

View changed files

📝 crates/horizon-client/src/game/commands/data.rs (+8 -0)
📝 crates/horizon-client/src/game/scoreboard.rs (+3 -5)

📄 Description

🤖 Opened by xFedeT's AI agent (Claude Code, Sonnet 5.5), not by xFedeT personally.

Fixes #6255

What was wrong

A server's players are Target::Guest (the window's player too, on the server thread). Game::tags_of (game/scoreboard.rs), which the tag= selector filter and /tag read, returned nothing for a guest, and raw_mut (commands/data.rs), which /tag add and /tag remove write through, had no compound for one: tag <player> add <tag> changed nothing that was kept and @a[tag=<tag>] matched no player, as the casino mod found.

What changes

A guest's tags are read from and written to Guest.saved, the saved player compound its players/data file is written from, so they also survive a rejoin.

Verification

Live on the server thread (offscreen, horizon-ctl): tag @s add casino says "Added tag", tag @s list shows casino, execute if entity @a[tag=casino] runs and @a[tag=nope] does not. Clippy and rustfmt clean for the changed files (the only clippy error is the existing needless_borrow in horizon-world).

Not done

No dedicated-server run with two guests, and no automated case: the command harness cases for guests (tools/test_command_exec_parity.py) could not run here (this machine's Python lacks hashlib.file_digest).

🤖 Generated with Claude Code


🔄 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/6288 **Author:** [@xFedeT](https://github.com/xFedeT) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `fix/selector-tag-players` --- ### 📝 Commits (2) - [`234a37b`](https://github.com/horizon-rust/horizon/commit/234a37bb9587be5568ccd4fee29e40aff4b82d50) Players on a server keep their tags: tag add/remove and @a[tag=...] work for guests - [`66359b4`](https://github.com/horizon-rust/horizon/commit/66359b4924eeba7a96c939d7ca3691c519e6aa36) Merge main into #6288 ### 📊 Changes **2 files changed** (+11 additions, -5 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/game/commands/data.rs` (+8 -0) 📝 `crates/horizon-client/src/game/scoreboard.rs` (+3 -5) </details> ### 📄 Description > 🤖 Opened by xFedeT's AI agent (Claude Code, Sonnet 5.5), not by xFedeT personally. Fixes #6255 ## What was wrong A server's players are `Target::Guest` (the window's player too, on the server thread). `Game::tags_of` (`game/scoreboard.rs`), which the `tag=` selector filter and `/tag` read, returned nothing for a guest, and `raw_mut` (`commands/data.rs`), which `/tag add` and `/tag remove` write through, had no compound for one: `tag <player> add <tag>` changed nothing that was kept and `@a[tag=<tag>]` matched no player, as the casino mod found. ## What changes A guest's tags are read from and written to `Guest.saved`, the saved player compound its `players/data` file is written from, so they also survive a rejoin. ## Verification Live on the server thread (offscreen, `horizon-ctl`): `tag @s add casino` says "Added tag", `tag @s list` shows `casino`, `execute if entity @a[tag=casino]` runs and `@a[tag=nope]` does not. Clippy and rustfmt clean for the changed files (the only clippy error is the existing `needless_borrow` in `horizon-world`). ## Not done No dedicated-server run with two guests, and no automated case: the command harness cases for guests (`tools/test_command_exec_parity.py`) could not run here (this machine's Python lacks `hashlib.file_digest`). 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:26:21 +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#6771
No description provided.