When you save a build with a structure block in Save mode, Minecraft writes it to an NBT file that you can load into any world. The same format is used by data packs for custom structures, and it is easy to edit once you see how the block list and the palette work together.
Where structures are saved
- Saved with a structure block: in the world folder,
generated/<namespace>/structures/<name>.nbtup to 1.21.11, andgenerated/<namespace>/structure/<name>.nbtfrom 26.1. A structure namedcastleuses theminecraftnamespace; one namedmypack:castlegoes undermypack. - In a data pack:
data/<namespace>/structure/(the folder wasstructuresbefore 1.21).
How the file is organized
- { }root
- IDataVersion4671
- [ ]size3 Ints: width, height, length
- [ ]palette
- { }0
- StrName"minecraft:oak_planks"
- { }1
- StrName"minecraft:chest"
- { }Properties
- Strfacing"north"
- Strtype"single"
- Strwaterlogged"false"
- { }0
- [ ]blocks
- { }0
- Istate0palette index
- [ ]pos3 Ints, relative to the corner
- { }1
- Istate1
- [ ]pos
- { }nbtthe chest's contents
- { }0
- [ ]entities
- { }0
- [ ]pos3 Doubles
- [ ]blockPos3 Ints
- { }nbtentity data
- { }0
[ ]palettelists each distinct block state once: a block id inStrNameand, for blocks with states, their{ }Properties. Property values are always Strings, even"false"and"3".[ ]blockshas one entry per block position.Istateis a position in the palette list (counting from 0), and[ ]posis the position relative to the structure's corner. Blocks with contents, such as chests or signs, also carry an{ }nbtcompound.[ ]entitiesholds mobs, armor stands, item frames and so on, with their exact position.[ ]sizegives the dimensions. Air is saved like any other block, which is why loading a structure clears what was there. Only positions filled with structure void blocks are left out ofblocks.
Swap a material everywhere
Because blocks point to the palette, changing one palette entry changes every block that uses it. To rebuild an oak house in spruce:
- Open the .nbt file in the editor and expand
palette. - Use the search box to find
oak. Changeminecraft:oak_plankstominecraft:spruce_planks,minecraft:oak_stairstominecraft:spruce_stairs, and so on. - Keep the
Propertiesas they are, as long as the new block has the same properties. Stairs keep theirfacing,halfandshape. - Download with the same name and put the file back. Load it with a structure block in Load mode.
If the new block doesn't have a property the old one had, the game ignores the extra property. If it needs a property that's missing, it uses the default value.
Other useful edits
- Remove all entities: open the ☰ menu on each entry in
entitiesand remove it, or switch to the SNBT view and replace the list with[]. - Change a chest's loot: find the chest's entry in
blocksand edit itsnbt › Items. Items use the same format as a player inventory, with aSlotfrom 0 to 26. - Turn a block's state: edit its palette entry's
Properties, for examplefacingfromnorthtoeast. Every block sharing that palette entry turns too.
Schematics and Bedrock structures
WorldEdit .schem files and Litematica .litematic files are gzip-compressed NBT as well, so the editor opens them. Both pack their block data into compact arrays that aren't meant to be edited by hand; the editor keeps those arrays byte for byte, so you can safely change names, metadata or entities and save the file.
Bedrock's .mcstructure files are uncompressed little-endian NBT. They use their own layout, with a structure compound holding block indices and a palette, but the editor reads and writes them in their original format.