# hbm:legacy_jigsaw

Assembles a jigsaw structure and grounds its pieces on terrain.

**since NTM 1.0.2**

Assembles a vanilla jigsaw structure, then grounds its pieces using [`hbm:legacy_start`](https://movblock.mov/ntm-next/wiki/world-generation/pool-elements/legacy_start.md) and [`hbm:legacy_piece`](https://movblock.mov/ntm-next/wiki/world-generation/pool-elements/legacy_piece.md) placement fields. A piece with `align_to_terrain: true` uses the average ocean-floor height across its own rotated footprint, plus `height_offset`. Other pieces move together by the offset calculated for the first unaligned piece. Heights are clamped to `min_height` and `max_height`; flat worlds retain the calculated height.

## Fields

| Field | Meaning and default | Range |
| - | - | - |
| `type` | `hbm:legacy_jigsaw`. | |
| `biomes` | Vanilla biome set eligible for placement. | |
| `spawn_overrides` | Vanilla mob-spawn overrides inside the structure. | |
| `step` | Vanilla generation step for the structure. | |
| `start_pool` | Starting template-pool ID or inline pool. | |
| `size` | Maximum jigsaw assembly depth. | `[1, 20]` |
| `min_height` (Optional) | Lower bound for the grounded piece height; default 1. | `i32` |
| `max_height` (Optional) | Upper bound for the grounded piece height; default 128. Must be at least `min_height`. | `i32` |

## Example:

File: `data/example/worldgen/structure/ruins.json`.

```json
{
  "type": "hbm:legacy_jigsaw",
  "biomes": "minecraft:desert",
  "spawn_overrides": {},
  "step": "surface_structures",
  "start_pool": "example:ruins/start",
  "size": 3,
  "min_height": 1,
  "max_height": 128
}
```
