[GH-ISSUE #3628] Structures from content mods are missing from command suggestions (/locate structure, /place structure) #1038

Closed
opened 2026-11-02 15:43:48 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @k3yh on GitHub (Oct 29, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/3628

What happens
A content mod that ships structures (data/<ns>/worldgen/structure/*.json, with their pools, sets and templates) loads fine: its structures generate, and /locate structure <ns>:<id> finds them. But they never show up in the suggestions: typing /locate structure <ns> and pressing Tab offers only vanilla's structures.

Why
crates/horizon-client/src/mod_content.rs, in the "command-registries.json" arm of the content merge: a mod's items and blocks are added to items, by_registry/minecraft:item/ids and by_registry/minecraft:block/ids, but its structures are never added to by_registry/minecraft:worldgen/structure/ids. The suggestions for ResOrTagKey("minecraft:worldgen/structure") (horizon-command/src/vanilla.rs) and /place structure (game/commands/place.rs) read that list. The command itself still works because the worldgen registry does have the structures.

Probably the same for minecraft:worldgen/template_pool (/place jigsaw) and template ids (/place template).

Reproduce

  1. A content mod with one structure, e.g. data/mymod/worldgen/structure/tower.json.
  2. Open a world with cheats on and type /locate structure mymod → no suggestion.
  3. /locate structure mymod:tower → "The nearest mymod:tower is at …".

Fix I tested locally
Appending the mod's structure ids to by_registry/minecraft:worldgen/structure/ids in the prepared command-registries.json, then clearing .horizon-cache/mod-content, makes Tab offer them. The merge could do the same from the structures it already reads (worldgen/structures.json).

Version
Seen on v0.2.97 and Nightly 2026-10-28 · 6f8c7a0, Windows 11. Still in main at 1816cf0.

Originally created by @k3yh on GitHub (Oct 29, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/3628 **What happens** A content mod that ships structures (`data/<ns>/worldgen/structure/*.json`, with their pools, sets and templates) loads fine: its structures generate, and `/locate structure <ns>:<id>` finds them. But they never show up in the suggestions: typing `/locate structure <ns>` and pressing Tab offers only vanilla's structures. **Why** `crates/horizon-client/src/mod_content.rs`, in the `"command-registries.json"` arm of the content merge: a mod's items and blocks are added to `items`, `by_registry/minecraft:item/ids` and `by_registry/minecraft:block/ids`, but its structures are never added to `by_registry/minecraft:worldgen/structure/ids`. The suggestions for `ResOrTagKey("minecraft:worldgen/structure")` (`horizon-command/src/vanilla.rs`) and `/place structure` (`game/commands/place.rs`) read that list. The command itself still works because the worldgen registry does have the structures. Probably the same for `minecraft:worldgen/template_pool` (`/place jigsaw`) and template ids (`/place template`). **Reproduce** 1. A content mod with one structure, e.g. `data/mymod/worldgen/structure/tower.json`. 2. Open a world with cheats on and type `/locate structure mymod` → no suggestion. 3. `/locate structure mymod:tower` → "The nearest mymod:tower is at …". **Fix I tested locally** Appending the mod's structure ids to `by_registry/minecraft:worldgen/structure/ids` in the prepared `command-registries.json`, then clearing `.horizon-cache/mod-content`, makes Tab offer them. The merge could do the same from the structures it already reads (`worldgen/structures.json`). **Version** Seen on v0.2.97 and Nightly 2026-10-28 · 6f8c7a0, Windows 11. Still in `main` at 1816cf0.
Author
Owner

@xFedeT commented on GitHub (Oct 29, 2026):

🤖 Agent: taking this one (Federico's agent).

<!-- gh-comment-id:6495876743 --> @xFedeT commented on GitHub (Oct 29, 2026): 🤖 Agent: taking this one (Federico's agent).
Author
Owner

@xFedeT commented on GitHub (Oct 29, 2026):

🤖 Agent: PR #3667 is open (Federico's agent): the content merge now adds a mod's structures, structure sets, template pools, processor lists and features to command-registries.json, and /place template lists the templates of every namespace. Tested in game by Federico with a small content mod. /place structure <id> still answers "unexpected error" for any structure (vanilla ones too): not part of this fix.

<!-- gh-comment-id:6499049194 --> @xFedeT commented on GitHub (Oct 29, 2026): 🤖 Agent: PR #3667 is open (Federico's agent): the content merge now adds a mod's structures, structure sets, template pools, processor lists and features to `command-registries.json`, and `/place template` lists the templates of every namespace. Tested in game by Federico with a small content mod. `/place structure <id>` still answers "unexpected error" for any structure (vanilla ones too): not part of this fix.
Author
Owner

@kira-horizon[bot] commented on GitHub (Oct 29, 2026):

Claimed by FedeT_ on Discord (GitHub: xFedeT), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #3628).

<!-- gh-comment-id:6502484964 --> @kira-horizon[bot] commented on GitHub (Oct 29, 2026): Claimed by `FedeT_` on Discord (GitHub: `xFedeT`), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #3628). <!-- kira:work -->
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#1038
No description provided.