[GH-ISSUE #938] /locate structure #minecraft:village finds a farther village than vanilla #263

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

Originally created by @ludovic111 on GitHub (Oct 18, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/938

🤖 Filed by Ludovic's AI agent (Claude), not by Ludovic himself.

Found while checking #917 on tydragon's seed -8713567381149888028 (current main 24bcef42, single player, at world spawn).

  • Horizon: /locate structure #minecraft:village -> "The nearest #minecraft:village (minecraft:village_plains) is at [-784, ~, -416] (846 blocks away)".
  • Vanilla 26.3 dedicated server, same seed: locate structure #minecraft:village -> "[-432, ~, 128] (419 blocks away)"; locate structure minecraft:village_plains gives the same.
  • In Horizon that plains village does exist at -432, 128 (bell at -428 113 130, 12 villagers with the #917 fix), and standing in it locate structure minecraft:village_plains finds it 0 blocks away, while the tag form still answers -784, -416.

So the tag form skips a nearer start that the single-structure form finds. To port: LocateCommand.locateStructure -> ChunkGenerator.findNearestMapStructure (the structure sets of every holder in the tag, each searched by getNearestGeneratedStructure for its placement, nearest overall kept).

Originally created by @ludovic111 on GitHub (Oct 18, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/938 > 🤖 Filed by Ludovic's AI agent (Claude), not by Ludovic himself. Found while checking #917 on tydragon's seed `-8713567381149888028` (current main 24bcef42, single player, at world spawn). - **Horizon:** `/locate structure #minecraft:village` -> "The nearest #minecraft:village (minecraft:village_plains) is at [-784, ~, -416] (846 blocks away)". - **Vanilla 26.3 dedicated server, same seed:** `locate structure #minecraft:village` -> "[-432, ~, 128] (419 blocks away)"; `locate structure minecraft:village_plains` gives the same. - In Horizon that plains village does exist at -432, 128 (bell at -428 113 130, 12 villagers with the #917 fix), and standing in it `locate structure minecraft:village_plains` finds it 0 blocks away, while the tag form still answers -784, -416. So the tag form skips a nearer start that the single-structure form finds. To port: `LocateCommand.locateStructure` -> `ChunkGenerator.findNearestMapStructure` (the structure sets of every holder in the tag, each searched by `getNearestGeneratedStructure` for its placement, nearest overall kept).
bsakaguchi 2026-11-02 15:37:44 +07:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@ludovic111 commented on GitHub (Oct 19, 2026):

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

<!-- gh-comment-id:6264391369 --> @ludovic111 commented on GitHub (Oct 19, 2026): Claimed by `ludovic` on Discord (GitHub: `ludovic111`), to avoid duplicate work. The claim lapses after 14 days without activity (a comment, a pull request or a commit mentioning #938). <!-- kira:work -->
Author
Owner

@ludovic111 commented on GitHub (Oct 19, 2026):

🤖 Agent: not a Horizon bug. /locate answers the same as vanilla 26.3 from the same position; the two runs in the report were started from different positions.

ChunkGenerator.findNearestMapStructure doesn't search for the nearest structure overall. For random-spread sets it walks rings of placement sectors around the source chunk and stops at the first ring where it finds something. In that ring it takes the first start in iteration order. So which village comes back depends on the source chunk, not just on the distance.

Vanilla 26.3 dedicated server, seed -8713567381149888028. The world spawn is -32 107 0 (setworldspawn at the console). Results with execute positioned … run locate structure …:

from #minecraft:village minecraft:village_plains
-38 64 -16 (chunk -3,-1) -784, -416 (846) -784, -416 (846)
-36 64 -8 (chunk -3,-1) -784, -416 (852) -784, -416 (852)
-33 64 0 (chunk -3,0) -432, 128 (419) -432, 128 (419)
-432 64 128 -432, 128 (0) -432, 128 (0)

Horizon (current main + #1002, single player, same seed) gives the same results. It spawned the player at -33.5 104 -3.5, which is in chunk z = -1:

  • at spawn, both forms: -784, -416 (855 blocks)
  • positioned -38 64 -16: -784, -416 (846)
  • positioned -432 64 128, tag form: -432, 128 (0 blocks)

The vanilla console answer (419) came from the world spawn (z = 0, chunk z = 0). Horizon's answer came from the player, who stood in chunk z = -1. Vanilla also scatters a joining player around the world spawn (spawn radius), so it can answer either way too. Both worldgen runs have plains village starts at chunks (-49,-26) and (-27,8) (vanilla VanillaStructureStartOracle).

The tag form returning -784, -416 while standing in the village didn't reproduce.

Closing as not a bug. Reopen if it shows up again from a known position.

<!-- gh-comment-id:6264516172 --> @ludovic111 commented on GitHub (Oct 19, 2026): 🤖 Agent: not a Horizon bug. `/locate` answers the same as vanilla 26.3 from the same position; the two runs in the report were started from different positions. `ChunkGenerator.findNearestMapStructure` doesn't search for the nearest structure overall. For random-spread sets it walks rings of placement sectors around the source chunk and stops at the first ring where it finds something. In that ring it takes the first start in iteration order. So which village comes back depends on the source chunk, not just on the distance. Vanilla 26.3 dedicated server, seed `-8713567381149888028`. The world spawn is `-32 107 0` (`setworldspawn` at the console). Results with `execute positioned … run locate structure …`: | from | `#minecraft:village` | `minecraft:village_plains` | | --- | --- | --- | | -38 64 -16 (chunk -3,-1) | -784, -416 (846) | -784, -416 (846) | | -36 64 -8 (chunk -3,-1) | -784, -416 (852) | -784, -416 (852) | | -33 64 0 (chunk -3,0) | -432, 128 (419) | -432, 128 (419) | | -432 64 128 | -432, 128 (0) | -432, 128 (0) | Horizon (current main + #1002, single player, same seed) gives the same results. It spawned the player at -33.5 104 -3.5, which is in chunk z = -1: - at spawn, both forms: -784, -416 (855 blocks) - positioned -38 64 -16: -784, -416 (846) - positioned -432 64 128, tag form: -432, 128 (0 blocks) The vanilla console answer (419) came from the world spawn (z = 0, chunk z = 0). Horizon's answer came from the player, who stood in chunk z = -1. Vanilla also scatters a joining player around the world spawn (spawn radius), so it can answer either way too. Both worldgen runs have plains village starts at chunks (-49,-26) and (-27,8) (vanilla `VanillaStructureStartOracle`). The tag form returning -784, -416 while standing in the village didn't reproduce. Closing as not a bug. Reopen if it shows up again from a known position.
Author
Owner

@ludovic111 commented on GitHub (Oct 19, 2026):

🤖 Agent: closing, see the comment above: same answers as vanilla 26.3 from the same positions.

<!-- gh-comment-id:6264516553 --> @ludovic111 commented on GitHub (Oct 19, 2026): 🤖 Agent: closing, see the comment above: same answers as vanilla 26.3 from the same positions.
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#263
No description provided.