.mcstructure
Saving and Loading Structures
The Export button can be used to create .mcstructure files from a structure block exclusively on Windows (other platforms cannot export structures). The files can then be placed into a behavior pack to load them in-game with a structure block or the /structure command.
The file path of the structure determines the structure identifier, which can be typed into the structure block to load the structure.
Examples:
BP/structures/house.mcstructure→mystructure:houseBP/structures/dungeon/entrance.mcstructure→dungeon:entranceBP/structures/stuff/towers/diamond.mcstructure→stuff:towers/diamond
The first subfolder defines the namespace, and subsequent folders define the path, ending with the structure file's name.
Note that any files directly in the BP/structures folder are given the mystructure namespace. If a structure with the same file name exists in both the BP/structures folder and an explicit BP/structures/mystructure folder, the game produces the following content log warning:
[structure][warning]-There was a conflict loading a structure in the default namespace. A structure with the name <name> was found both in the root directory and the mystructure directory.In this case, the file in the mystructure folder overrides the file directly in the structures folder.
Format Versions
There are two versions of the file format, stored in the format_version tag:
- Version 1 is the original format.
- Version 2 was added in 1.26.50. It stores block indices as int arrays, which reduces the time and memory needed to save and load structures. It also leaves out the secondary layer when it is empty, which makes those files about half the size. In 1.26.60, version 2 files gained compression, which the game now uses when exporting.
The game can load both versions. Version 1 structures are saved as version 2 the next time the game saves them.
File Format
NBT Format
— Root tag of the structure template.
![]()
format_version—1or2, see Format Versions.
![]()
compression— Optional, version 2 only. Added in 1.26.60. See Compression.
0or missing: thestructuretag is not compressed.1: thestructuretag is compressed with zlib.
![]()
size— List of three integers describing the size of the structure's bounds.
— Size of the structure in the X direction.
— Size of the structure in the Y direction.
— Size of the structure in the Z direction.
![]()
structure— Contains the blocks and entities in the structure. Ifcompressionis1, this is instead a byte array holding the zlib-compressed NBT of this compound.
![]()
block_indices— Associates block permutations from the block palette with positions in the structure. See more details here.
![]()
entities— List of entities as NBT, stored in the same way as entities in the world file itself. Tags likePosandUniqueIDare saved, but replaced upon loading.
![]()
palette— Contains named palettes of block permutation and position data. It is presumably formatted in this way to support multiple variants of the same structure, however currently onlydefaultis saved and loaded.
![]()
default— A single palette (currently onlydefaultis supported).
![]()
block_palette— A block palette listing block permutations in the structure.
![]()
block_position_data— Associates additional data with block positions in the structure. See more details here.
![]()
structure_world_origin— List of three integers describing where in the world the structure was initially saved.
- Equal to the position of the saving structure block, plus its offset settings.
- This is used to determine where entities should be placed when loading. An entity's new absolute position is equal to its old position, minus these values, plus the origin of the structure's loading position.
— Structure origin X position.
— Structure origin Y position.
— Structure origin Z position.
Compression
Since 1.26.60, the game compresses the structure tag when it exports a version 2 structure. Only the structure tag is compressed. Tools must still accept uncompressed files, which have compression set to 0 or missing. The rest of the root compound, including format_version, size and structure_world_origin, stays readable as plain NBT.
To read a compressed structure:
- Check that
compressionis1. - Decompress the
structurebyte array with zlib. - Read the result as little-endian NBT. It is the same compound an uncompressed file would contain.
To write one, serialize the structure compound as little-endian NBT, compress it with zlib, store it as a byte array in structure and set compression to 1.
Block Indices
Each structure contains one or two arrays of block indices, which are integers that correspond to a block permutation from the block palette for a given block position. A structure has a primary layer and, optionally, a secondary layer, allowing for co-located blocks (such as those that are waterlogged) to be stored. Version 1 files always have both layers. Version 2 files leave out the secondary layer when nothing is stored in it.
Each sublist proceeds in ZYX order from the bottom north-west corner of the structure to the top south-east corner. For example, if the structure is 2×3×4 blocks in size, then the 24 (product of the dimensions) values in each layer represent the blocks located at
0 0 0,0 0 1,0 0 2,0 0 3,0 1 0,0 1 1,0 1 2,0 1 3,0 2 0,0 2 1,0 2 2,0 2 3,1 0 0,1 0 1,1 0 2,1 0 3,1 1 0,1 1 1,1 1 2,1 1 3,1 2 0,1 2 1,1 2 2,1 2 3relative to the origin.An index of
-1indicates a void in the structure where no block exists, causing any existing block to remain upon loading. This occurs when structure voids are saved, and is the case for most blocks in the secondary layer.
NBT Format
block_indices — List containing one or two entries, one for each block layer. Both layers share the same palette.
Version 1: two lists of int tags.
— List of block palette indices in the primary layer.
— List of block palette indices in the secondary layer.
Version 2: one int array for the primary layer, plus an optional one for the secondary layer.
Int array — Block palette indices in the primary layer.
Int array — Block palette indices in the secondary layer. Optional.
Block Palette
The block palette is a list of all block permutations that are included in the structure.
NBT Format
block_palette — List containing block permutations
— A single block permutation, following a similar format to block descriptors.
![]()
name— The identifier of the block type, such as"minecraft:planks".
![]()
states— The block's states as keys and values.
- The values are the appropriate NBT type for the state: strings for string states, integers for integer states, and bytes for boolean states.
- Examples:
"minecraft:cardinal_direction": "north","bite_counter": 3,"open_bit": 1b.
![]()
version— Compatibility versioning number for this block.
- As of 1.26.30, this version is set to
18168865which is hex01 15 3C 21, meaning1.21.60.33.
Block Position Data
NBT Format
block_palette — Maps block positions to their additional data.
![]()
<index>— Contains additional block data of the block at the index position.
![]()
block_entity_data— Block entity data as NBT, stored exactly the same as block entities in the world file itself.
- Position tags are saved but replaced upon loading.
- Layer is unspecified as multiple block entities cannot coexist in a block space.
![]()
tick_queue_data— Contains one more compounds of queued (also known as pending or scheduled) tick information.
- This is used for blocks like coral to make it die, water to make it flow, and other various queued updates such as custom blocks with the
minecraft:tickcomponent.
— A single queued tick.
![]()
tick_delay— The number of game ticks remaining until this block should tick.
What Happens If…
Results from testing to see what happens when modified structure files are loaded. These results are for version 1 and have not been retested on version 2.
If the dimensions in
sizeexceed the vanilla save the limit of 64×256×64, the structure can still be loaded just as expected.If the values in the block layer lists are not int tags, all values are treated as
0.If a value in the block layer list is equal to or larger than the palette size or less than
-1, an air block is placed.If the
defaultpalette is not present, loading the structure results in no blocks being placed.If any of the tags that have constant names are unspecified or are the wrong tag type, the structure fails to load with the following content log error:
[Structure][error]-Loading structure '<identifier>` from behavior pack: '<path>' | "<tag>" field, a required field, is missing from the structure.Version 1: if
block_indicesdoes not contain exactly two values, the structure fails to load with the following content log error:[Structure][error]-Loading structure '<identifier>` from behavior pack: '<path>' | The "block_indices" field should be an array with 2 arrays and instead we have <count> arrays.Version 1: if the values inside of
block_indicesdo not list tags, the structure fails to load with the following content log error:[Structure][error]-Loading structure '<identifier>` from behavior pack: '<path>' | The "block_indices" field's first array is either missing or not a list.Version 1: if the length of the two lists in
block_indicesare not equal, the structure fails to load with the following content log error:[Structure][error]-Loading structure '<identifier>` from behavior pack: '<path>' | The "block_indices" field's arrays need to both be the same size.Version 1: if the length of the two lists in
block_indicesdoes not equal the product of the structure's dimensions, the structure fails to load with the following content log error:[Structure][error]-Loading structure '<identifier>` from behavior pack: '<path>' | The "block_indices" field should have as many elements as defined by the "size" field.
Bedrock & Java Comparison
NBT files, as adapted by Java and Bedrock's .mcstructure files have many major differences. However, they do have some things in common: they're stored in NBT format and use index arrays and palettes.
Here are a few main differences:
| Feature | Bedrock Edition | Java Edition |
|---|---|---|
| File extension | .mcstructure | .nbt |
| Compression | Optional zlib since 1.26.60, none before | Gzip |
| Endianness | Little-endian | Big-endian |
| Uncompressed file size | Smaller as the order of blocks hardcoded, only palette indexes saved | Larger as each block is stored as (location, palette index, optional NBT) |
| Compressed file size | Larger if the file is not compressed | Smaller as Gzip outperforms the more compact uncompressed .mcstructure format. |
Tool Support
Tools written before 1.26.50 may not support version 2 or compressed files. Amulet Core reads and writes both. For writing your own tools, see the NBT libraries.
NBT Editors
You can find download links for some NBT editors here.





