Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Minecraft:Jigsaw structure

From SAS Gaming Wiki
Revision as of 11:07, 14 May 2026 by SyncBot (talk | contribs) (Sync: new page from Minecraft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Template:Infobox structure Jigsaw structures are Minecraft:structures that generate using Minecraft:jigsaw blocks.

They are used to generate Template:EnvLink, Template:EnvLink, Template:EnvLink, Template:EnvLink, Template:EnvLink, and Template:EnvLink. The jigsaw structure generation can be customized using Minecraft:data packs Template:In or Minecraft:add-ons Template:In.

Generation

The generation places a number of pieces. A piece is usually a Minecraft:structure template, but can also be a Minecraft:placed feature. The pieces are organized into Minecraft:template pools. During generation pieces are randomly selected from a given template pool.

When a structure is generated starting from a given chunk, it generates in a number of steps, detailed below.

Step 1: Starting piece

A jigsaw structure defines a Template:NbtTemplate:Nbt. A piece is selected from this pool and placed at the starting position. Rotation and the starting template are chosen randomly, based on the chunk coordinates and the world seed. If the selected piece is a Template:Cd, the structure fails to generate.Template:Only<ref group="note" name="fail">When the structure fails to generate, it can't be located using Template:Cmd and other structures from the same Minecraft:structure set can take its place.</ref> The starting position is the 0, 0 chunk coordinate of the starting chunk. If the Template:NbtTemplate:Only/Template:NbtTemplate:Only is set, the start height is based on the specified Minecraft:heightmap, offset by the values result of Template:NbtTemplate:Nbt. Otherwise, Template:NbtTemplate:Nbt is used to determine the start height.

If the structure defines a Template:Nbt, then a jigsaw block with that name is randomly selected and then placed at the starting position. If no matching jigsaw block is found, the structure fails to generate.<ref group="note" name="fail" /> If the structure has Template:Nbt unset, the north west corner of the (unrotated) piece is placed at the starting position.

If the final starting piece position is not at least Template:Nbt blocks away from the lower build limit and Template:Nbt blocks away from the upper build limit, the structure fails to generate.<ref group="note" name="fail" />

Finally, the starting piece is put into a generation queue.

Step 2: Connecting pieces

The generation queue is processed sequentially. A piece is removed from the queue when it is processed. Of the processed (parent) piece all jigsaw blocks are then used to generate a connecting piece. The jigsaw blocks are handled in order from high to low selection priority set in each jigsaw block and a random order of jigsaw blocks with equal selection priority.

Connecting piece selection

The jigsaw block is referencing a "target pool". The "target pool" is used as an alias by the pool aliases referenced in Template:Nbt to determine which Minecraft:template pool to use. If no pool alias is used then the "target pool" directly references the template pool to use.

The connecting piece is determined using that template pool in following order:

  1. All the pieces from the template pool — in random order according to their weight.
  2. All the pieces from the fallback pool specified in the template pool — in random order according to their weight.

If the maximum depth (defined by Template:NbtTemplate:Only/Template:NbtTemplate:Only) is reached, point 1 is skipped.

Connecting piece try

From the tried piece a random jigsaw block is selected, that

  1. is facing outside of the bounds of the connecting piece
  2. has a "name" that matches the "target name" of the parent jigsaw block,
  3. has an orientation that is compatible with the parent jigsaw orientation (pieces can be rotated horizontally only).

The piece is placed in the world such that the jigsaw blocks connect to each other. If the currently handled piece or the newly selected piece is set to terrain matching, the piece is moved vertically to align with the terrain.

Piece placement condition

The placement is then checked for validity. A piece has to:

  1. Not exceed the outer bounding box. If it is placed within another piece, then the bounding box of that piece is the outer bounding box<ref group="note" name="expansion_hack">When Template:Nbt is set to Template:Cd, the bounding box of the pieces is extended to the height of the highest possible child piece (except when parent piece is generated by the Template:NbtTemplate:Nbt).</ref>, otherwise the outer bounding box is determined as:
  2. Not intersect with any other piece (except those that it is placed inside of)
  3. If parent is inside of grandparent, then not be outside of grandparent

If the piece can't be placed, then the placement is retried with the next piece (see #Connecting piece selection). If all pieces can't be placed than no piece is placed for this jigsaw block.

If the piece can be placed, then the newly placed piece is added to the generation queue according to the placement priority specified in the parent jigsaw block, but behind elements of equal placement priority already in the queue. The generation continues with the next jigsaw block of the parent piece.

Step 3: Processing

Finally, each piece is processed, changing or removing blocks from the template.

The processing is done using the Minecraft:processor list specified for each piece in the template pool. Additionally, jigsaw blocks are replaced with the specified "Turns into" final state (using the Template:Cd processor Template:In). For pieces set to terrain matching each column of blocks is adjusted in height match the terrain (using the Template:Cd processor Template:In).

Notes: <references group="note"/>

Pool aliases

Pool aliases are used to redirect the alias "target pool" referenced in Minecraft:jigsaw blocks to a (different) Minecraft:template pools. The redirections are determined before the generation starts, so in a single structure all references to a specific alias template pool are rewired to the same target template pool. Any alias that is not redirected by a pool alias is used directly as reference to a template pool.

direct

All references to Template:Nbt are rewired to Template:Nbt.

random

A target selected from Template:Nbt per structure. All references to Template:Nbt are rewired that target.

random_group

A alias group is selected from Template:Nbt per structure. All pool aliases in that group are used.

Data values

ID

Template:El: Template:ID table

Config

Template:El:

<section begin="config"/>

<section end="config"/>

Template:El:

History

Java Edition

Template:HistoryTable

Bedrock Edition

Template:HistoryTable

Navigation

Template:Navbox generated structures

Minecraft:de:Verbundblock-Konstruktion Minecraft:fr:Structure en puzzle Minecraft:pt:Estrutura de bloco-quebra-cabeça