Wiki 9Minecraft Wiki 9Minecraft

Generating Custom Jigsaw Structures

How to build and spawn multi-piece structures in Bedrock Edition using jigsaw blocks and feature rules.

5Sections
3Code examples
4Known errors

Jigsaw structures are modular builds made from multiple `.mcstructure` files that snap together during world generation, just like vanilla villages, pillager outposts, and trial chambers. You reach for jigsaw generation when a single static structure template is too small or too repetitive, and you want randomized layouts, branching hallways, or terrain-hugging streets.

How Jigsaw Generation Works in Bedrock

At its core, a jigsaw structure is a collection of saved `.mcstructure` files inside your behavior pack's `structures/` folder. Each piece contains one or more `minecraft:jigsaw` blocks on its edges. During generation, the game places a starting piece, reads the jigsaw blocks inside it, and looks up a target pool of other `.mcstructure` files that have matching connection names.

Unlike Java Edition, which has used a pure JSON data-pack registry for template pools and structure sets for several years, Bedrock Edition's data-driven jigsaw system has evolved differently. In current stable Bedrock releases, custom structures are primarily placed into the world through the `features/` and `feature_rules/` folders using `minecraft:structure_template_feature`. Mojang has also introduced experimental data-driven jigsaw registries in recent previews, which are still subject to change.

Authoring Structure Pieces in Game

Before writing any JSON, you have to build your pieces in a creative world and configure their connectors. Give yourself both a structure block and a jigsaw block using `/give @s structure_block` and `/give @s jigsaw`. Build your starting room (for example, a dungeon entrance) and your branching pieces (hallways, corners, dead ends).

Place a `minecraft:jigsaw` block on the exact edge where a new piece should attach, with the arrow texture pointing outward toward the space the new piece will occupy. When you interact with the jigsaw block, a menu opens with several configuration fields that control how pieces link up and what happens to the jigsaw block after generation finishes.

Once your jigsaw blocks are configured on a piece, surround the piece with a bounding box using a `minecraft:structure_block` in Save mode. Always include entities if your piece uses armor stands or markers, and export the file to disk. Move all exported `.mcstructure` files into a subfolder of your behavior pack, such as `BP/structures/dungeon/`.

Jigsaw UI FieldWhat it doesNotes
Target PoolIdentifies the pool of structure pieces this block can pull from.Uses a namespace:path identifier, such as mypack:dungeon_hallways.
NameThe connector label on this specific jigsaw block.Must match the Target Name on the incoming piece if the generator checks two-way alignment.
Target NameThe connector label this block looks for on the candidate piece being attached.For example, a hallway exit might look for a target name of mypack:room_entrance.
Turns IntoThe block identifier that replaces the jigsaw block once structure placement is complete.Set to minecraft:air for open doorways, or minecraft:stone_bricks to seal a wall.
Joint TypeControls whether the attached piece can rotate freely (Rollable) or must match orientation (Aligned).Rollable is used for vertical shafts; Aligned is standard for horizontal hallways.

Placing Pieces with Structure Template Features

To actually get your structure into a newly generated chunk, the stable Bedrock approach uses `minecraft:structure_template_feature`. While this feature places a single `.mcstructure` file at a time, creators routinely combine it with `minecraft:aggregate_feature`, `minecraft:sequence_feature`, and `minecraft:scatter_feature` to assemble multi-part procedural layouts without relying on unfinished experimental toggles.

Inside `BP/features/`, create a JSON file whose `identifier` matches the filename. The `structure_name` field references your file inside `BP/structures/` without the `.mcstructure` file extension. If your file is at `BP/structures/dungeon/entrance.mcstructure`, the identifier is `dungeon:entrance` (the subfolder becomes the namespace).

The `constraints` object is critical for multi-piece structures. An empty `unburied: {}` constraint forces the top of the piece to be exposed to air, while `grounded: {}` forces the bottom layer of the structure to rest on solid terrain so hallways do not float over ravines.

BP/features/dungeon_entrance_feature.json
{
  "format_version": "1.20.30",
  "minecraft:structure_template_feature": {
    "description": {
      "identifier": "mypack:dungeon_entrance_feature"
    },
    "structure_name": "dungeon:entrance",
    "adjustment_radius": 8,
    "facing_direction": "random",
    "constraints": {
      "grounded": {},
      "block_intersection": {
        "block_allowlist": [
          "minecraft:stone",
          "minecraft:dirt",
          "minecraft:grass_block",
          "minecraft:deepslate"
        ]
      }
    }
  }
}

Chaining Pieces Together with Scatter Features

If you are building a procedural dungeon or village Cluster in stable Bedrock without experimental jigsaw pools, you chain pieces by pairing `minecraft:sequence_feature` with `minecraft:scatter_feature`. A sequence feature runs a list of features in exact order at the same origin point. By offsetting subsequent scatter features by the exact block width of your `.mcstructure` templates, you can snap randomized rooms onto a central hub.

To randomize which room attaches to a doorway, point your offset `minecraft:scatter_feature` at a `minecraft:weighted_random_feature`. That weighted list acts exactly like a jigsaw template pool, picking one `.mcstructure` feature from your list based on numeric weights.

BP/features/dungeon_room_pool_feature.json
{
  "format_version": "1.20.30",
  "minecraft:weighted_random_feature": {
    "description": {
      "identifier": "mypack:dungeon_room_pool_feature"
    },
    "features": [
      [ "mypack:dungeon_hallway_feature", 4 ],
      [ "mypack:dungeon_treasure_room_feature", 1 ],
      [ "mypack:dungeon_spawner_room_feature", 2 ]
    ]
  }
}

Spawning the Structure with Feature Rules

A feature does nothing until a feature rule attaches it to a generation pass and a biome filter. Create a file in `BP/feature_rules/` that targets the `surface_pass` or `underground_pass`. Use `minecraft:biome_filter` to restrict where your structure can appear, such as overworld plains or underground dripstone caves.

Keep the `iterations` count to `1` and use a low `scatter_chance` when spawning large structures. Because feature rules evaluate per chunk, a high scatter chance will flood the world with overlapping structure pieces and severely lag chunk generation.

BP/feature_rules/overworld_dungeon_rule.json
{
  "format_version": "1.20.30",
  "minecraft:feature_rules": {
    "description": {
      "identifier": "mypack:overworld_dungeon_rule",
      "places_feature": "mypack:dungeon_entrance_feature"
    },
    "conditions": {
      "placement_pass": "surface_pass",
      "minecraft:biome_filter": [
        {
          "test": "has_biome_tag",
          "operator": "==",
          "value": "overworld"
        },
        {
          "test": "has_biome_tag",
          "operator": "!=",
          "value": "ocean"
        }
      ]
    },
    "distribution": {
      "iterations": 1,
      "scatter_chance": {
        "numerator": 1,
        "denominator": 80
      },
      "x": 0,
      "z": 0,
      "y": "query.heightmap(variable.worldx, variable.worldz)"
    }
  }
}

Which versions this applies to

Structure template features, weighted random features, and feature rules work in stable Bedrock Edition 1.20.30 and newer without any experimental toggles. Native JSON jigsaw template pools and structure sets are currently under active development in recent 1.21.x Preview builds and require experimental toggles or preview builds if used directly.

When it does not work

What you seeWhyThe fix
[Features][error]-feature_name | Failed to find structure templateThe `structure_name` inside `minecraft:structure_template_feature` does not match the subfolder and filename inside `BP/structures/`. Bedrock treats the first subfolder under `BP/structures/` as the namespace.Place your `.mcstructure` file inside a subfolder, for example `BP/structures/mypack/room_a.mcstructure`, and set `structure_name` to `mypack:room_a`.
Feature file fails to load with a Content Log error stating the identifier does not match the file name.In Bedrock Edition, every file inside `BP/features/` and `BP/feature_rules/` must have a filename (excluding `.json`) that matches the path part of its `description.identifier`.If your identifier is `mypack:dungeon_entrance_feature`, rename the JSON file to `BP/features/dungeon_entrance_feature.json`.
Structure pieces never spawn even when `scatter_chance` is set to 100%, with no errors in the Content Log.The `constraints` block on `minecraft:structure_template_feature` is too strict for the Y level chosen in the feature rule. For example, `unburied: {}` will fail every time if the Y coordinate places the structure underground, and `block_intersection` will fail if the bounding box touches water, tall grass, or leaves not listed in `block_allowlist`.Temporarily remove the `constraints` object (`"constraints": {}`) to confirm your feature rule and coordinates work, then add `grounded` or `block_intersection` back one at a time.
Visible `minecraft:jigsaw` blocks remain inside the generated structure in survival mode.The `Turns Into` field inside the jigsaw block UI was left blank or set to an invalid block identifier when the `.mcstructure` was exported, or the structure was placed directly via `structure_template_feature` which does not evaluate jigsaw replacement blocks.If placing via `structure_template_feature`, replace the jigsaw markers before exporting the `.mcstructure`. If using jigsaw generation, open the `.mcstructure` in a test world, set `Turns Into` to `minecraft:air` (or your wall block), and re-export.

Reference, straight from the game files

Read out of the game itself, so the ids match the version you are building for.