[PR #7601] Use villager professions in command display names #7708

Open
opened 2026-11-03 07:22:20 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/7601
Author: @TheMrZZ
Created: 11/2/2026
Status: 🔄 Open

Base: main ← Head: fix/villager-command-name


📝 Commits (3)

  • 16d3c1d Use villager professions in command display names
  • 0325f87 Merge main into villager command name fix
  • ef4d301 Merge main into villager command name fix

📊 Changes

4 files changed (+123 additions, -13 deletions)

View changed files

📝 crates/horizon-client/src/entity_nbt.rs (+66 -0)
📝 crates/horizon-client/src/game/commands.rs (+5 -13)
📝 crates/horizon-client/src/mobs.rs (+18 -0)
📝 tools/command_exec_corpus.py (+34 -0)

📄 Description

🤖 Opened by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally.

What and why

Fixes #7587. An unnamed cleric now appears as Cleric in command replies instead of Villager. Command mob names use the loaded villager profession's translation component, with CustomName taking precedence. Other mob types retain their existing type names.

Move the existing mob command-name selection into a small Mob helper and add the Villager profession branch. Loaded-NBT tests cover none, nitwit, cleric, farmer and librarian, custom-name precedence, zombie villagers, wandering traders and a custom entity namespace. The baseline generic-key behavior fails the villager regression; the profession branch passes both focused tests.

The native command corpus adds 54 observations of VillagerData, Pos and Rotation reply prefixes, including live profession changes and custom names. Template transforms, renderer, player and armor-stand paths are separate.

Kind

  • parity: Horizon now does what vanilla 26.3 does

Vanilla reference

Java 26.3 Villager.getTypeName returns getVillagerData().profession().value().name(). VillagerProfession registrations construct Component.translatable("entity." + namespace + ".villager." + path), including entity.minecraft.villager.none and .nitwit; none has no generic-key exception. Custom names take precedence.

The original igloo-bottom reproduction has matching VillagerData, Pos and Rotation payloads but different names in command replies. This PR tests the naming behavior directly without changing template placement. The focused native Java/Horizon command comparison passes all 54 observations; template-placement runtime parity remains outside this check.

Other projects' code

None.

Self-check

Fresh pinned Java 26.3 versus the resolved Horizon binary: 54/54 command-execution observations match. Coverage includes none, nitwit, cleric, farmer and librarian; custom-name precedence; profession changes; and zombie-villager/wandering-trader controls.

pr_ready (tools/pr_ready.py --quick on a local runner, against origin/main at 31f83499b, 9 min 14 s)

Check Result
Scope ✅ 4 files, +123 −13
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 614 passed (1 min 6 s)
rustfmt ✅ (7 s)
clippy ✅ (1 min 14 s)
tests: horizon-client, horizon-client-lib ✅ 2209 passed (6 min 32 s)
doc tests ✅ 0 passed (3 s)
content root tests ➖ content root untouched
mod API up to date ✅ (12 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 Codex.


🔄 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/7601 **Author:** [@TheMrZZ](https://github.com/TheMrZZ) **Created:** 11/2/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/villager-command-name` --- ### 📝 Commits (3) - [`16d3c1d`](https://github.com/horizon-rust/horizon/commit/16d3c1dfa56b029b70bd981c9f47f9b6918dd402) Use villager professions in command display names - [`0325f87`](https://github.com/horizon-rust/horizon/commit/0325f870e3ee931a5c475bbdf87fa78f19f4efee) Merge main into villager command name fix - [`ef4d301`](https://github.com/horizon-rust/horizon/commit/ef4d301ec4f696c5e657c4e5046f0e6eb8974402) Merge main into villager command name fix ### 📊 Changes **4 files changed** (+123 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client/src/entity_nbt.rs` (+66 -0) 📝 `crates/horizon-client/src/game/commands.rs` (+5 -13) 📝 `crates/horizon-client/src/mobs.rs` (+18 -0) 📝 `tools/command_exec_corpus.py` (+34 -0) </details> ### 📄 Description > 🤖 Opened by TheMrZZ's AI agent (Codex, gpt-6.1-sol), not by TheMrZZ personally. ## What and why Fixes #7587. An unnamed cleric now appears as Cleric in command replies instead of Villager. Command mob names use the loaded villager profession's translation component, with CustomName taking precedence. Other mob types retain their existing type names. Move the existing mob command-name selection into a small Mob helper and add the Villager profession branch. Loaded-NBT tests cover none, nitwit, cleric, farmer and librarian, custom-name precedence, zombie villagers, wandering traders and a custom entity namespace. The baseline generic-key behavior fails the villager regression; the profession branch passes both focused tests. The native command corpus adds 54 observations of VillagerData, Pos and Rotation reply prefixes, including live profession changes and custom names. Template transforms, renderer, player and armor-stand paths are separate. ## Kind - [x] parity: Horizon now does what vanilla 26.3 does ## Vanilla reference Java 26.3 `Villager.getTypeName` returns `getVillagerData().profession().value().name()`. `VillagerProfession` registrations construct `Component.translatable("entity." + namespace + ".villager." + path)`, including `entity.minecraft.villager.none` and `.nitwit`; none has no generic-key exception. Custom names take precedence. The original igloo-bottom reproduction has matching VillagerData, Pos and Rotation payloads but different names in command replies. This PR tests the naming behavior directly without changing template placement. The focused native Java/Horizon command comparison passes all 54 observations; template-placement runtime parity remains outside this check. ## Other projects' code None. ## Self-check Fresh pinned Java 26.3 versus the resolved Horizon binary: **54/54 command-execution observations match**. Coverage includes none, nitwit, cleric, farmer and librarian; custom-name precedence; profession changes; and zombie-villager/wandering-trader controls. **pr_ready** (`tools/pr_ready.py --quick` on a local runner, against origin/main at 31f83499b, 9 min 14 s) | Check | Result | | --- | --- | | Scope | ✅ 4 files, +123 −13 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 614 passed (1 min 6 s) | | rustfmt | ✅ (7 s) | | clippy | ✅ (1 min 14 s) | | tests: horizon-client, horizon-client-lib | ✅ 2209 passed (6 min 32 s) | | doc tests | ✅ 0 passed (3 s) | | content root tests | ➖ content root untouched | | mod API up to date | ✅ (12 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 [Codex](https://openai.com/codex/). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
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#7708
No description provided.