Minecraft:Structure file: Difference between revisions
More actions
imported>Jacobsjo Undo revision 3430672 by EmeraldBuilder (talk) Unless this is a recent change, this is not true: Structure blocks in bedrock use a different format, which this page is not about. |
Remove broken links to missing pages |
||
| Line 1: | Line 1: | ||
{{about|the format used by structure blocks|the similar format used by many community programs|Schematic file format}} | {{about|the format used by structure blocks|the similar format used by many community programs|Schematic file format}} | ||
A '''structure file''' (also called '''structure template''') is an | A '''structure file''' (also called '''structure template''') is an NBT file that stores small structures of blocks and entities. Structure files are used to store some structures such as end cities, igloos, and [[Minecraft:fossil]]s. | ||
== Usage == | == Usage == | ||
=== Java Edition === | === Java Edition === | ||
Structure files are stored as .nbt files in | Structure files are stored as .nbt files in data packs in the {{file|directory|inline=1|data/{{ph|namespace}}/structure}} folder. | ||
They can be saved and loaded using the [[Minecraft:Structure Block]]. When saved from Structure Blocks they are saved into the {{cd|generated/{{ph|namespace}}/structures}} subfolder in the world save folder. When no namespace is given, then the {{cd|minecraft}} namespace is used. | They can be saved and loaded using the [[Minecraft:Structure Block]]. When saved from Structure Blocks they are saved into the {{cd|generated/{{ph|namespace}}/structures}} subfolder in the world save folder. When no namespace is given, then the {{cd|minecraft}} namespace is used. | ||
| Line 746: | Line 746: | ||
{{collapse|title={{EnvLink|village}}|content= | {{collapse|title={{EnvLink|village}}|content= | ||
** common | ** common | ||
*** animals: Spawns a | *** animals: Spawns a jigsaw block which sets the position of an animal. | ||
**** {{nbt|compound}} cat_black | **** {{nbt|compound}} cat_black | ||
**** {{nbt|compound}} cat_british | **** {{nbt|compound}} cat_british | ||
| Line 1,156: | Line 1,156: | ||
===Bedrock Edition=== | ===Bedrock Edition=== | ||
Structure files are stored using the | Structure files are stored using the NBT format in the game files. In [[Minecraft:behavior pack]]s, they are stored as {{cd|.mcstructure}} files in the {{cd|structures/{{ph|namespace}}}} folder. | ||
==== Prebuild structures ==== | ==== Prebuild structures ==== | ||
| Line 2,291: | Line 2,291: | ||
<div class="treeview"> | <div class="treeview"> | ||
* {{nbt|compound}} The root tag. | * {{nbt|compound}} The root tag. | ||
** {{nbt|integer|DataVersion}} | ** {{nbt|integer|DataVersion}}: Data version of the NBT structure. | ||
** <s>{{nbt|string|author}}</s>: Name of the player who created this structure. Only exists for structures saved before 1.13. | ** <s>{{nbt|string|author}}</s>: Name of the player who created this structure. Only exists for structures saved before 1.13. | ||
** {{nbt|list|size}}: 3 TAG_Int describing the size of the structure. | ** {{nbt|list|size}}: 3 TAG_Int describing the size of the structure. | ||
** {{nbt|list|palette}}: Set of different block states used in the structure. | ** {{nbt|list|palette}}: Set of different block states used in the structure. | ||
*** {{nbt|compound}} A block. | *** {{nbt|compound}} A block. | ||
**** {{nbt|string|Name}}: | **** {{nbt|string|Name}}: Block ID. | ||
**** {{nbt|compound|Properties}}: List of | **** {{nbt|compound|Properties}}: List of block state properties. | ||
***** {{nbt|string|{{ph|state property name}}}}: The value of the corresponding state property. | ***** {{nbt|string|{{ph|state property name}}}}: The value of the corresponding state property. | ||
** {{nbt|list|palettes}}: Sets of different block states used in the structure, a random palette gets selected based on coordinates. Used in vanilla by shipwrecks. | ** {{nbt|list|palettes}}: Sets of different block states used in the structure, a random palette gets selected based on coordinates. Used in vanilla by shipwrecks. | ||
*** {{nbt|list}} A set of different block states used in the structure. | *** {{nbt|list}} A set of different block states used in the structure. | ||
**** {{nbt|compound}} A block. | **** {{nbt|compound}} A block. | ||
***** {{nbt|string|Name}}: | ***** {{nbt|string|Name}}: Block ID. | ||
***** {{nbt|compound|Properties}}: List of | ***** {{nbt|compound|Properties}}: List of block state properties. | ||
****** {{nbt|string|{{ph|state property name}}}}: The value of the corresponding state property. | ****** {{nbt|string|{{ph|state property name}}}}: The value of the corresponding state property. | ||
** {{nbt|list|blocks}}: List of individual blocks in the structure. | ** {{nbt|list|blocks}}: List of individual blocks in the structure. | ||
| Line 2,309: | Line 2,309: | ||
**** {{nbt|integer|state}}: Index of the block in the palette. | **** {{nbt|integer|state}}: Index of the block in the palette. | ||
**** {{nbt|list|pos}}: 3 TAG_Int describing the position of this block. | **** {{nbt|list|pos}}: 3 TAG_Int describing the position of this block. | ||
**** {{nbt|compound|nbt}}: NBT of the associated [[Minecraft:block entity]] (optional, only present if the block has one). Does not contain x, y, or z fields. See | **** {{nbt|compound|nbt}}: NBT of the associated [[Minecraft:block entity]] (optional, only present if the block has one). Does not contain x, y, or z fields. See Block entity format. | ||
** {{nbt|list|entities}}: List of entities in the structure. | ** {{nbt|list|entities}}: List of entities in the structure. | ||
*** {{nbt|compound}} An entity. | *** {{nbt|compound}} An entity. | ||
**** {{nbt|list|pos}}: 3 TAG_Double describing the exact position of the entity. | **** {{nbt|list|pos}}: 3 TAG_Double describing the exact position of the entity. | ||
**** {{nbt|list|blockPos}}: 3 TAG_Int describing the block position of the entity. | **** {{nbt|list|blockPos}}: 3 TAG_Int describing the block position of the entity. | ||
**** {{nbt|compound|nbt}}: NBT of the entity (required). See | **** {{nbt|compound|nbt}}: NBT of the entity (required). See entity format. | ||
</div> | </div> | ||
| Line 2,324: | Line 2,324: | ||
|{{HistoryLine||1.10|dev=16w20a|Changed structure files to their current format. Before this, {{nbt|list|palette}} did not exist. Instead of referring to an index in the palette, {{nbt|int|state}} encoded the block ID and metadata at that position. The last byte encodes the block id, and the second-to-last byte encodes the block data.}} | |{{HistoryLine||1.10|dev=16w20a|Changed structure files to their current format. Before this, {{nbt|list|palette}} did not exist. Instead of referring to an index in the palette, {{nbt|int|state}} encoded the block ID and metadata at that position. The last byte encodes the block id, and the second-to-last byte encodes the block data.}} | ||
|{{HistoryLine||1.11|Removed {{nbt|int|version}}. Before its removal, its value was always <code>1</code>. | |{{HistoryLine||1.11|Removed {{nbt|int|version}}. Before its removal, its value was always <code>1</code>. | ||
|Added {{nbt|int|DataVersion}} that is set to the | |Added {{nbt|int|DataVersion}} that is set to the data version of the version of the game that saved the file.}} | ||
|{{HistoryLine||1.21|dev=24w21a|Moved structure files from {{file|directory|inline=1|structures}} to {{file|directory|inline=1|structure}}.}} | |{{HistoryLine||1.21|dev=24w21a|Moved structure files from {{file|directory|inline=1|structures}} to {{file|directory|inline=1|structure}}.}} | ||
}} | }} | ||
| Line 2,335: | Line 2,335: | ||
[[Category:Structures]] | [[Category:Structures]] | ||
de:Konstruktionsvorlagen | |||
fr:Fichier de structure | |||
ja:構造物ファイルフォーマット | |||
pt:Modelo de estrutura | |||
zh:结构存储格式 | |||
Revision as of 16:06, 9 April 2026
|
For the {{{Description}}} of the same name, see [[{{{Destination}}}]]. |
A structure file (also called structure template) is an NBT file that stores small structures of blocks and entities. Structure files are used to store some structures such as end cities, igloos, and Minecraft:fossils.
Usage
Java Edition
Structure files are stored as .nbt files in data packs in the Template:File folder.
They can be saved and loaded using the Minecraft:Structure Block. When saved from Structure Blocks they are saved into the Template:Cd subfolder in the world save folder. When no namespace is given, then the Template:Cd namespace is used.
Structure files can also be placed using the Template:Cmd command. They are also used during the generation of some Minecraft:structures and of Minecraft:fossil features.
Prebuild structures
Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse Template:Collapse
Template:CollapseBedrock Edition
Structure files are stored using the NBT format in the game files. In Minecraft:behavior packs, they are stored as Template:Cd files in the Template:Cd folder.
Prebuild structures
NBT structure
All the specified positions are relative to the block located toward -X, -Y, -Z.
- Template:Nbt The root tag.
- Template:Nbt: Data version of the NBT structure.
Template:Nbt: Name of the player who created this structure. Only exists for structures saved before 1.13.- Template:Nbt: 3 TAG_Int describing the size of the structure.
- Template:Nbt: Set of different block states used in the structure.
- Template:Nbt A block.
- Template:Nbt: Block ID.
- Template:Nbt: List of block state properties.
- Template:Nbt: The value of the corresponding state property.
- Template:Nbt A block.
- Template:Nbt: Sets of different block states used in the structure, a random palette gets selected based on coordinates. Used in vanilla by shipwrecks.
- Template:Nbt A set of different block states used in the structure.
- Template:Nbt A block.
- Template:Nbt: Block ID.
- Template:Nbt: List of block state properties.
- Template:Nbt: The value of the corresponding state property.
- Template:Nbt A block.
- Template:Nbt A set of different block states used in the structure.
- Template:Nbt: List of individual blocks in the structure.
- Template:Nbt An individual block.
- Template:Nbt: Index of the block in the palette.
- Template:Nbt: 3 TAG_Int describing the position of this block.
- Template:Nbt: NBT of the associated Minecraft:block entity (optional, only present if the block has one). Does not contain x, y, or z fields. See Block entity format.
- Template:Nbt An individual block.
- Template:Nbt: List of entities in the structure.
- Template:Nbt An entity.
- Template:Nbt: 3 TAG_Double describing the exact position of the entity.
- Template:Nbt: 3 TAG_Int describing the block position of the entity.
- Template:Nbt: NBT of the entity (required). See entity format.
- Template:Nbt An entity.
History
Template:Navbox Java Edition technical
de:Konstruktionsvorlagen fr:Fichier de structure ja:構造物ファイルフォーマット pt:Modelo de estrutura zh:结构存储格式