Wiki 9Minecraft Wiki 9Minecraft

How to Control Structure Rarity and Prevent Overlapping Builds

Adjusting Chunk Spacing

When configuring a <structure name>.json file inside your datapack's structure_spawners/ folder, you control how often a building appears using two chunk-distance settings:

  • averageSpacing: This required integer sets the average horizontal distance in chunks between spawn attempts. Raise this number to make the structure rarer across your world.
  • minimumSpacing: This optional integer sets the strict minimum distance in chunks between two structures of this exact type. If you omit this line, it automatically defaults to half of your averageSpacing (averageSpacing / 2).

Preventing Collisions Between Different Structures

If you have multiple custom schematics spawning in the same pack, they might occasionally generate on top of one another. You can stop this by configuring the avoidOthers and seed options in your JSON file:

1. Add "avoidOthers": true to your spawner configuration (this also defaults to true if your placement is already set to avoid villages). When enabled, the spawner checks nearby chunks for any other structures that also have avoidOthers set to true and will only generate if none are nearby. Note that cave structures only check against other cave structures.

2. Avoid giving two different structures the exact same averageSpacing and seed integer. Structures that share both the same spacing and the same seed will target the exact same chunks during generation.