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

Minecraft:Structure set: Difference between revisions

From SAS Gaming Wiki
SyncBot (talk | contribs)
Sync: new page from Minecraft
 
SyncBot (talk | contribs)
Sync: updated from Minecraft
 
(4 intermediate revisions by the same user not shown)
Line 18: Line 18:
****{{nbt|float|spacing}}: Size in chunks of the grid space used to place the structure
****{{nbt|float|spacing}}: Size in chunks of the grid space used to place the structure
****{{nbt|float|separation}}: Padding between placements of set placements.
****{{nbt|float|separation}}: Padding between placements of set placements.
****{{nbt|string|spread_type}}: Algorithm used when placing structures. Can be <code>linear</code>.
****{{nbt|string|spread_type}}: Algorithm used when placing structures. Can be <code>linear</code> or <code>triangular</code>.
***{{nbt|list|structures}}: Weighted list of structures that can be placed.
***{{nbt|list|structures}}: Weighted list of structures that can be placed.
****{{nbt|compound}}: A structure to be placed.
****{{nbt|compound}}: A structure to be placed.
*****{{nbt|string|structure}}: A structure identifer.
*****{{nbt|string|structure}}: A structure identifier.
*****{{nbt|float|weight}}: Determines the chance of it being chosen over others. Must be a positive integer.
*****{{nbt|float|weight}}: Determines the chance of it being chosen over others. Must be a positive integer.
</div>
</div>
Line 27: Line 27:
The placement type determines how the structures are spread in a world. There are two placement types.
The placement type determines how the structures are spread in a world. There are two placement types.
=== random_spread ===
=== random_spread ===
Structures are spread evenly in the entire world. In vanilla, this placement type is used for most structures (like [[Minecraft:bastion remnant]]s or [[Minecraft:swamp hut]]s{{only|java}}). Starting from chunk 0 0 and moving outwards {{nbt|int|spacing}} number of chunks, grid of initial positions is created. After that the offset is applied to each position by X and Z separatelly based on the additional fields.
[[File:Random spread distribution plot.png|300px|thumb|right|Orange line is {{cd|linear}} distribution of offset value and blue line is {{cd|triangular}}]]
Structures are spread evenly throughout the entire world. In vanilla, this placement type is used for most structures (like [[Minecraft:bastion remnant]]s or [[Minecraft:swamp hut]]s{{only|java}}). Starting from chunk 0 0 and moving outwards {{nbt|int|spacing}} number of chunks, a grid of initial positions is created. After that the offset is applied to each position by X and Z separately based on the additional fields.


[[File:Random spread distribution plot.png|300px|thumb|right|Orange line is {{cd|linear}} distribution of offset value and blue line is {{cd|triangular}}]]
<div class="treeview">
<div class="treeview">
* additional fields:
* additional fields:
** {{nbt|string|spread_type}}: (optional, defaults to {{cd|linear}}) One of {{cd|linear}} or {{cd|triangular}}. {{cd|linear}} sets offset to radnom value between 0 and {{cd|spacing - separation - 1}}(inclusive). {{cd|triangular}} takes sum of 2 random numbers between 0 and {{cd|spacing - separation - 1}} (inclusive) then divides that sum by 2, rounding down to nearest integer. That value results in less random offset, where values have much higher chance to be closer to the middle of distribution, than to the sides.
** {{nbt|string|spread_type}}: (optional, defaults to {{cd|linear}}) One of {{cd|linear}} or {{cd|triangular}}. {{cd|linear}} sets offset to a random value between 0 and {{cd|spacing - separation - 1}} (inclusive). {{cd|triangular}} takes the sum of 2 random numbers between 0 and {{cd|spacing - separation - 1}} (inclusive) then divides that sum by 2, rounding down to nearest integer. This value results in less random offset, where values have a much higher chance to be closer to the middle of the distribution, than to the sides.
** {{nbt|int|spacing}}: Average distance between two neighboring generation attempts. Value between 0 and 4096 (inclusive).
** {{nbt|int|spacing}}: Average distance between two neighboring generation attempts. Value between 0 and 4096 (inclusive).
** {{nbt|int|separation}}: Minimum distance (in chunks) between two neighboring attempts. Value between 0 and 4096 (inclusive). Has to be strictly smaller than {{nbt|int|spacing}}. The maximum distance of two neighboring generation attempts is {{cd|2*spacing - separation}}.
** {{nbt|int|separation}}: Minimum distance (in chunks) between two neighboring attempts. Value between 0 and 4096 (inclusive). Has to be strictly smaller than {{nbt|int|spacing}}. The maximum distance of two neighboring generation attempts is {{cd|2*spacing - separation}}.
Line 39: Line 39:
=== concentric_rings ===
=== concentric_rings ===
{{exclusive|java|section=1}}
{{exclusive|java|section=1}}
A fixed number of structures is placed in concentric rings around the origin of the world. In vanilla, this placement is only used for [[Minecraft:stronghold]]s.  
[[File:Strongholds 1.9.svg|300px|thumb|right|Concentric rings, used in [[stronghold]]s]]
A fixed number of structures are placed in concentric rings around the origin of the world. In vanilla, this placement is only used for [[Minecraft:stronghold]]s.  


<div class="treeview">
<div class="treeview">
* additional fields:
* additional fields:
** {{nbt|integer|distance}}: The thickness of a ring plus that of a gap between two rings. Value between 0 and 1023 (inclusive). Unit is '''6 chunks'''
** {{nbt|integer|distance}}: The thickness of a ring plus the thickness of a gap between two rings. Ring and gap are equal in thickness. Value between 0 and 1023 (inclusive). Unit is '''6 chunks'''
** {{nbt|integer|count}}: The total number of generation attempts in this dimension. Value between 1 and 4095 (inclusive).
** {{nbt|integer|count}}: The total number of generation attempts in this dimension. Value between 1 and 4095 (inclusive).
** {{nbt|string}}{{nbt|list|preferred_biomes}}: {{json ref/biome|tag=1}} &mdash; Biomes in which the structure is likely to be generated{{info needed|it is unclear how the "likely" mechanic works}}.
** {{nbt|string}}{{nbt|list|preferred_biomes}}: {{json ref/biome|tag=1}} &mdash; Biomes in which the structure is likely to be generated. After choosing the initial position of generation, a search in a square with a radius of 112 blocks begins. It proceeds from -X to +X, from -Z to +Z in 4×4 squares. When a position inside a biome from {{nbt|string}}{{nbt|list|preferred_biomes}} is found, it is considered the new position. If multiple positions are found, one is chosen randomly. If no positions are found, the initial position is used.
** {{nbt|integer|spread}}: How many attempts are on the closest ring to spawn. Value between 0 and 1023 (inclusive). The number of attempts on the Nth ring is: {{cd|spread * (N^2 + 3 * N + 2) / 6}}, until the number of attempts reaches the total {{nbt|integer|count}}.
** {{nbt|integer|spread}}: How many attempts are on the closest ring to spawn. Value between 0 and 1023 (inclusive). The number of attempts on the Nth ring is: {{cd|spread * (N^2 + 3 * N + 2) / 6}}, until the number of attempts reaches the total {{nbt|integer|count}}.
</div>
</div>

Latest revision as of 11:12, 29 May 2026

A structure set is used to determine the position of structures in the world during world generation. They are configured using Minecraft:JSON files stored within a Minecraft:data pack in the path Template:Cd or an Minecraft:add-on in the path Template:Cd. Structure sets are not referenced in a dimension or biome. Instead, the existence of the resource is enough to make the structures generate. The valid biomes of a structure are determined by the structure itself (see Minecraft:Structure/JSON format).

The structure sets uses the Template:Nbt to determine the placement of structures. For any position a random structure is selected from the Template:Nbt list. If the selected structure can't be placed because its not in a valid biome, a different structure is selected.

JSON format

Template:El: Minecraft:Structure set/JSON format

Template:El:

Placement types

The placement type determines how the structures are spread in a world. There are two placement types.

random_spread

File:Random spread distribution plot.png
Orange line is Template:Cd distribution of offset value and blue line is Template:Cd

Structures are spread evenly throughout the entire world. In vanilla, this placement type is used for most structures (like Minecraft:bastion remnants or Minecraft:swamp hutsTemplate:Only). Starting from chunk 0 0 and moving outwards Template:Nbt number of chunks, a grid of initial positions is created. After that the offset is applied to each position by X and Z separately based on the additional fields.

  • additional fields:
    • Template:Nbt: (optional, defaults to Template:Cd) One of Template:Cd or Template:Cd. Template:Cd sets offset to a random value between 0 and Template:Cd (inclusive). Template:Cd takes the sum of 2 random numbers between 0 and Template:Cd (inclusive) then divides that sum by 2, rounding down to nearest integer. This value results in less random offset, where values have a much higher chance to be closer to the middle of the distribution, than to the sides.
    • Template:Nbt: Average distance between two neighboring generation attempts. Value between 0 and 4096 (inclusive).
    • Template:Nbt: Minimum distance (in chunks) between two neighboring attempts. Value between 0 and 4096 (inclusive). Has to be strictly smaller than Template:Nbt. The maximum distance of two neighboring generation attempts is Template:Cd.

concentric_rings

Template:Exclusive

File:Strongholds 1.9.svg
Concentric rings, used in strongholds

A fixed number of structures are placed in concentric rings around the origin of the world. In vanilla, this placement is only used for Minecraft:strongholds.

  • additional fields:
    • Template:Nbt: The thickness of a ring plus the thickness of a gap between two rings. Ring and gap are equal in thickness. Value between 0 and 1023 (inclusive). Unit is 6 chunks
    • Template:Nbt: The total number of generation attempts in this dimension. Value between 1 and 4095 (inclusive).
    • Template:NbtTemplate:Nbt: Template:Json ref/biome — Biomes in which the structure is likely to be generated. After choosing the initial position of generation, a search in a square with a radius of 112 blocks begins. It proceeds from -X to +X, from -Z to +Z in 4×4 squares. When a position inside a biome from Template:NbtTemplate:Nbt is found, it is considered the new position. If multiple positions are found, one is chosen randomly. If no positions are found, the initial position is used.
    • Template:Nbt: How many attempts are on the closest ring to spawn. Value between 0 and 1023 (inclusive). The number of attempts on the Nth ring is: Template:Cd, until the number of attempts reaches the total Template:Nbt.

Default structure sets

Structure set Structures Template:Tooltip Template:Tooltip Salt Notes
ancient_cities Template:EnvLink 8 24 20083232
buried_treasures Template:EnvLink 0 1 0 Probability of 1%, locate_offset of x:9, y:0, z:9
desert_pyramids Template:EnvLink 8 32 14357617
end_cities Template:EnvLink 11 20 10387313
igloos Template:EnvLink 8 32 14357618
jungle_temples Template:EnvLink 8 32 14357619
mineshafts Template:EnvLink
Template:EnvLink
0 1 0 Probability of 0.4%
nether_complexes 40% Template:EnvLink
60% Template:EnvLink
4 27 30084232
nether_fossils Template:EnvLink 1 2 14357921
ocean_monuments Template:EnvLink 5 32 10387313 Triangular spread type
ocean_ruins Template:EnvLink 8 20 14357621
pillager_outposts Template:EnvLink 8 32 165745296 Probability of 20%, exclusion zone of 10 chunks from any village
ruined_portals Template:EnvLink 15 40 34222645
shipwrecks Template:EnvLink 4 24 165745295
strongholds Template:EnvLink 0 Concentric rings distance=32 count=128 spread=3
swamp_huts Template:EnvLink 8 32 14357620
trail_ruins Template:EnvLink 8 34 83469867
trial_chambers Template:EnvLink 12 34 94251327
villages Template:EnvLink
Template:EnvLink
Template:EnvLink
Template:EnvLink
Template:EnvLink
8 34 10387312
woodland_mansions Template:EnvLink 20 80 10387319 Triangular spread type

External links

Navigation

Template:Navbox Java Edition technical

Minecraft:de:Konstruktionssammlung Minecraft:fr:Ensemble de structures Minecraft:pt:Conjunto de estruturas Minecraft:zh:结构集