Wiki 9Minecraft Wiki 9Minecraft

.mcstructure File Format and Usage

How to export, organize, and load saved structure NBT files in Bedrock behavior packs.

5Sections
1Code examples
3Known errors

A .mcstructure file is a binary NBT file that stores a 3D volume of blocks, entities, and block entity data captured from a Minecraft Bedrock world. Add-on creators use these files to package custom buildings, dungeons, and trees directly inside a behavior pack. Once placed in the pack, structures can be spawned manually with commands, generated naturally through world generation features, or placed dynamically via the Script API.

Folder Location and Identifiers

All structure files belong in the structures folder at the root of your behavior pack. Unlike blocks or entities, a .mcstructure file does not contain an internal JSON identifier definition. Instead, Minecraft derives the structure's identifier directly from its subfolder path and file name.

Because the root structures directory maps to the default mystructure namespace unless organized into subfolders, you should always create a subfolder named after your add-on's namespace inside BP/structures/. For example, a file placed at BP/structures/my_addon/watchtower.mcstructure is referenced in commands and JSON files as my_addon:watchtower. If you place watchtower.mcstructure directly in BP/structures/ with no subfolder, the game assigns it the identifier mystructure:watchtower.

Creating and Exporting Structures

You create .mcstructure files inside the game using a Structure Block (`minecraft:structure_block`). After giving yourself one via `/give @s structure_block`, place it down and open its UI to set the bounding box size and offset around your build. Switch the block to Save mode, type a name using the `namespace:name` format, and choose whether to include entities or remove blocks.

To get the actual file out of the game on Windows, click the Export button at the bottom of the Structure Block menu. This opens a standard system file dialog allowing you to save the .mcstructure file directly to your development folder. On platforms where the Export button is not available, saving the structure to disk writes it into the world's internal database; you must instead export the build on a Windows device or extract it from the world's LevelDB storage using an external NBT editor.

Before saving any structure meant for natural world generation, replace solid air pockets that should not overwrite terrain with Structure Void blocks (`minecraft:structure_void`). When the structure loads, any coordinate holding a Structure Void leaves the existing world block untouched instead of replacing it with air.

Internal NBT Layout

Unlike most behavior pack assets, a .mcstructure file is not human-readable JSON. It is an uncompressed binary NBT file written in little-endian byte order. You do not edit this file by hand in a text editor, though you can inspect it with a Bedrock-compatible NBT viewer if you need to check which custom blocks or entities were captured inside it.

The root compound tag of the file stores the dimensions of the capture volume, the coordinate where it was originally taken, and the block and entity arrays. Block placement uses two separate layers inside the grid indices so a single coordinate can hold both a primary block (such as a fence or stairs) and a secondary waterlogging block (`minecraft:water`).

NBT TagTypeWhat it stores
format_versionIntVersion of the structure format, always set to 1 in current releases.
sizeList of 3 IntsThe X, Y, and Z dimensions of the structure volume in blocks.
structure_world_originList of 3 IntsThe world coordinates where the structure was originally saved.
structureCompoundHolds the block_indices lists, entities list, and the palette compound mapping indices to block states and block entity data.

Spawning Structures with Worldgen Features

The most common use for .mcstructure files in an add-on is natural terrain generation. To place a structure into the world as chunks generate, you wrap it in a `minecraft:structure_template_feature` file inside `BP/features/`. This JSON file tells the game which structure file to load, which direction it can face, and what constraints must be met before it places.

In the example below, the feature references `BP/structures/my_addon/outpost.mcstructure` via its `structure_name` field. The `grounded` constraint forces the bottom layer of the structure to sit entirely on solid terrain so your building does not hang off the edge of a cliff.

BP/features/outpost_feature.json
{
  "format_version": "1.13.0",
  "minecraft:structure_template_feature": {
    "description": {
      "identifier": "my_addon:outpost_feature"
    },
    "structure_name": "my_addon:outpost",
    "adjustment_radius": 8,
    "facing_direction": "random",
    "constraints": {
      "grounded": {},
      "unburied": {}
    }
  }
}

Loading Structures via Commands and Script API

Outside of world generation, you can place any packaged .mcstructure file on demand using the `/structure load` command inside functions or command blocks. The command accepts rotation, mirror settings, animation modes, and an integrity percentage for ruined builds. In `mcfunction` files, this is the standard way to build multi-room arenas or reset minigame maps.

If your behavior pack uses `@minecraft/server`, you can also manipulate and place structures through the `StructureManager` class accessed via `world.structureManager`. Script access allows you to check whether a structure exists in the pack, place it in a specific dimension, or even create temporary structures in memory at runtime.

Which versions this applies to

Applies to Bedrock Edition 1.13.0 and above. Loading .mcstructure files via commands, features, or the stable Script API does not require any experimental toggles.

When it does not work

What you seeWhyThe fix
Running /structure load returns: "Failed to load structure my_addon:outpost"The file path inside BP/structures/ does not match the namespace and name used in the command, or the file still has a .json or duplicate .mcstructure.mcstructure extension hidden by your operating system.Ensure the file is located at BP/structures/my_addon/outpost.mcstructure and verify file extensions are visible in your file manager.
Structure generates in the world but cuts a rectangular cube of air into surrounding hills and trees.Empty space inside the Structure Block bounding box was saved as standard air blocks (minecraft:air), which overwrite whatever blocks already exist in the world when the structure loads.Fill the exterior empty spaces of your build with minecraft:structure_void before exporting the .mcstructure file, or use the block_intersection constraint in your structure_template_feature.
Custom blocks inside a loaded structure appear as purple-and-black info_update blocks.The .mcstructure palette stores the exact block identifiers and block states present when the build was exported. If you renamed a custom block identifier or removed a block state from your behavior pack afterwards, the saved palette entry no longer matches.Place the structure in a test world, replace the broken blocks with the updated custom blocks, and re-export the .mcstructure file.

Reference, straight from the game files

Read out of the game itself, so the ids match the version you are building for.