Bedrock Wiki
  • Discord
  • Contribute
  • bedrock.dev
  • MS Learn
Beginner's Guide
  • Guide
    • 1. Introduction
      guide
    • 2. Add-Ons Explained
    • 3. Software & Preparation
    • 4. Project Setup
    • 5. Create a Custom Item
    • 6. Create a Custom Entity
    • 7. Blockbench: Modeling, Texturing & Animating
    • 8. Adding Loot Tables, Spawn Rules & Crafting Recipes
  • Extra
    • a. Understanding JSON
    • b. Download Example Packs
    • c. Troubleshooting
      help
    • d. Advanced Manifest
    • e. Format Versions
    • f. Project Setup Android
Animation Controllers
  • Intro to Animation Controllers
    guide
  • Entity Commands
  • AFK Detector
  • Death Commands
  • Molang into Scoreboard
  • Respawn Commands
Blocks
  • General
    • Intro to Blocks
      guide
    • Block Components
    • Block Tags
    • Block States
    • Block Traits
    • Block Permutations
    • Block Events
      Scripts
    • Block Event Migration
      help
    • Blocks as Items
    • Multi-Blocks
    • Troubleshooting Blocks
      help
  • Sound & Visuals
    • Intro to Block Visuals
      guide
    • Block Culling
    • Block Models
      guide
    • Block Sounds
    • Block Texture Animation
    • Block Texture Variation
    • Block Tinting
  • Tutorials
    • Applying Effects
      Scripts
    • Avoiding State Limit
    • Block Orientation
    • Fake Blocks
      Scripts
    • Intercardinal Orientation
      Scripts
    • Ore Loot Tables
      Scripts
    • Tool-Based Destruction
  • Vanilla Re-Creations
    • Custom Crops
      Scripts
    • Custom Glass
    • Custom Glazed Terracotta
    • Custom Heads
      Scripts
    • Custom Trapdoors
      Scripts
  • Documentation
    • Block Co-Location
    • Block Format History
    • Block Shapes
    • Redstone Components
    • Vanilla Block Models
    • Vanilla Block Sounds
    • Vanilla Block Tags
    • Vanilla Voxel Shapes
Commands
  • General
    • Intro to Command Blocks
    • Understanding Selectors
    • Functions
      guide
    • Block States
    • Coordinate System
    • Giving NBT Items
    • Scoreboard Operations
  • Commands
    • Damage
    • Execute
    • Playanimation
    • Playsound
  • On Event Systems
    • On First World Load
      function
    • On Player First Join
    • On Player Join
    • On Player Leave
    • On Player Death
    • On Player Respawn
  • Scoreboard Systems
    • Entity Counter
    • Scoreboard Timers
    • Comparing And Retrieving Scores
  • Detection Systems
    • Look Detection
    • Item Drop Detection
    • Movement Detections
    • Rain Detection
  • Techniques
    • Execute Logic Gates
      concept
    • Execute at Block Variant
    • Execution Forking
      concept
    • Binary in Commands
      concept
    • MBE - Max's Block Entity
    • FMBE - A New Way to Create Display Entities
    • Dynamic Displays
    • Orbital Camera
  • Useful Creations
    • Sphere Command
    • Compass Display
    • Custom Crafting
    • Multiplayer Position Rearrangement
      function
Concepts
  • contents.json
  • Molang
  • Namespaces
  • Overwriting Assets
  • Shaders
  • Sounds
  • Subpacks
  • Texture Atlases
  • textures_list.json
Documentation
  • Advanced Molang
  • File Types
  • Fog IDs
  • Material Configuration Description
  • Molang Queries
  • Pack Folder Structure
  • Shared Constructs
  • Sound Definitions
  • Vanilla Materials
Entities
  • General
    • Intro to Entities BP
      guide
    • Intro to Entities RP
      guide
    • Troubleshooting Entities
      help
    • Entity Events
    • Entity Properties
    • NPC Dialogue
    • Render Controllers
    • Spawn Rules
  • Tutorials
    • Area Effect Clouds
    • Coordinate Space Conversion
    • Creating Boats
    • Detecting Other Entities
    • Disabling Team Damage
    • Dummy Entities
    • Entity Attacks
    • Entity Movement
    • Entity Timers
    • Holding Items
    • Invulnerable Entities
    • Look at Entity
    • Riding Flying Entities
    • Sleeping Entities
    • Solid Entities
    • Spawning Tamed Entities
      Scripts
    • Village Mechanic
  • Documentation
    • Dummy Components
    • Non-Mob Runtime Identifiers
    • Projectiles
    • Runtime Identifiers
    • Vanilla Usage Components
    • Vanilla Usage Spawn Rules
Items
  • General
    • Intro to Items
      guide
    • Item Components
    • Item Tags
    • Item Events
      Scripts
    • Item Event Migration
      help
    • Item Catalog
    • Troubleshooting Items
      help
  • Tutorials
    • Equipment-Based Commands
    • Spawning Items
    • Throwable Items
  • Vanilla Re-Creations
    • Custom Armor
    • Custom Food
      Scripts
    • Custom Pottery Sherds
    • Custom Weapons
  • Documentation
    • Enchantments
    • Attachables
    • Item Format History
    • Numerical Item IDs
    • Vanilla Item Groups
    • Vanilla Item Tags
    • Vanilla Usage Components
JSON UI
  • General
    • Intro to JSON UI
      guide
    • Best Practices
      guide
  • Tutorials
    • Adding HUD Elements
    • Aseprite Animations
    • Buttons and Toggles
    • Modifying Server Forms
    • Preserve Title Texts
    • String to Number
  • Documentation
    • JSON UI Documentation
Loot, Recipes & Trading
  • General
    • Trading Behavior
  • Documentation
    • Loot Tables
    • Trade Tables
    • Recipes
    • Item Functions
  • Tutorials
    • Randomized Structure Loot
Meta
  • Add-On Performance
  • Style Guide
  • Useful Links
  • Using Schemas
  • Version Control
  • Q&A
    • Blocks and Items Q&A 2024/08/30
    • Deferred Technical Preview Q&A 2024/02/23
    • GameTest Q&A 2021/08/06
    • Scripting and Editor Q&A 2023/09/22
    • World Generation Q&A 2024/11/15
NBT
  • General
    • .mcstructure
  • Tutorials
    • Enabling Experiments by Editing NBT
    • Extending Structure Limits
  • NBT in Depth
    • About NBT (Named Binary Tag)
    • NBT Libraries
    • Reading NBT Example
Particles
  • General
    • Intro to Particles
      guide
  • Tutorials
    • Disabling Particles
  • Documentation
    • Vanilla Particles
Scripting
  • General
    • Intro to Scripting
    • What is Script API?
    • API Modules
  • Tutorials
    • Script Core Features
    • Block Placement Prevention
    • Custom Commands
    • GameTests
    • Script Privileges
    • Script Requests API
    • Server Forms
  • Documentation
    • Engine Environment
    • Script Resources
    • Script Watchdog
    • Troubleshooting JavaScript
    • TypeScript
Servers
  • Software
    • Bedrock Server Software
  • Protocols
    • Bedrock Protocol
    • NetherNet Protocol
    • RakNet Protocol
Text & Localization
  • General
    • Intro to Text & Localization
    • Raw Text
    • Splashes
  • Emojis & Symbols
    • Fonts
    • Intro to Emojis
    • Custom Emojis
    • Input Keys
Visuals
  • General
    • Introduction to Entity Visuals
      guide
    • Bedrock Modeling
    • Custom Death Animations
    • Effects in Animations
    • Material Creations
    • Materials
    • Math-Based Animations
    • Skin Packs
  • Tutorials
    • Entity Texture Animation
    • Glowing Entity Texture
    • Hurt Animations
    • Leash Position
    • Player Geometry
    • Remove Entity Shadows
    • Retexturing Spawn Eggs
  • Ideas
    • Structure Presentation
World Generation
  • General
    • Intro to World Generation
      guide
    • Biomes
      guide
    • Feature Types
    • Jigsaw Structures
  • Tutorials
    • Block Conditions for Features
    • Generating Custom Ores
    • Generating Custom Structures
    • Generating Patches
    • Heightmap Noise
  • Documentation
    • Biome Tags

.mcstructure

.mcstructure
  • Saving and Loading Structures
  • File Format
    • Block Indices
    • Block Palette
    • Block Position Data
  • What Happens If…
  • Bedrock & Java Comparison
  • NBT Editors

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:house
  • BP/structures/dungeon/entrance.mcstructure → dungeon:entrance
  • BP/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.
1

In this case, the file in the mystructure folder overrides the file directly in the structures folder.

File Format ​

NBT Format

Compound — Root tag of the structure template.

Integer format_version — Currently always set to 1.

List size — List of three integers describing the size of the structure's bounds.

Integer — Size of the structure in the X direction.

Integer — Size of the structure in the Y direction.

Integer — Size of the structure in the Z direction.

Compound structure — Contains the blocks and entities in the structure.

List block_indices — Associates block permutations from the block palette with positions in the structure. See more details here.

List entities — List of entities as NBT, stored in the same way as entities in the world file itself. Tags like Pos and UniqueID are saved, but replaced upon loading.

Compound 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 only default is saved and loaded.

Compound default — A single palette (currently only default is supported).

List block_palette — A block palette listing block permutations in the structure.

Compound block_position_data — Associates additional data with block positions in the structure. See more details here.

List 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.

Integer — Structure origin X position.

Integer — Structure origin Y position.

Integer — Structure origin Z position.

Block Indices ​

Each structure contains two lists of block indices, which are integers that correspond to a block permutation from the block palette for a given block position. Having two lists of block indices creates a primary and secondary block layer, allowing for co-located blocks (such as those that are waterlogged) to be stored.

  • 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 list 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 3 relative to the origin.

  • An index of -1 indicates 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

List block_indices — List containing two sublists, one for each block layer. Both layers share the same palette.

List — List of block palette indices in the primary layer.

List — List of block palette indices in the secondary layer.

Block Palette ​

The block palette is a list of all block permutations that are included in the structure.

NBT Format

List block_palette — List containing block permutations

Compound — A single block permutation, following a similar format to block descriptors.

String name — The identifier of the block type, such as "minecraft:planks".

Compound 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.

Integer version — Compatibility versioning number for this block.

  • As of 1.26.30, this version is set to 18168865 which is hex 01 15 3C 21, meaning 1.21.60.33.

Block Position Data ​

NBT Format

Compound block_palette — Maps block positions to their additional data.

Compound <index> — Contains additional block data of the block at the index position.

Compound 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.

List 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:tick component.

Compound — A single queued tick.

Integer 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:

  • If the dimensions in size exceed 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 default palette 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.
    1
  • If block_indices does 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.
    1
  • If the values inside of block_indices do 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.
    1
  • If the length of the two lists in block_indices are 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.
    1
  • If the length of the two lists in block_indices does 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.
    1

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:

FeatureBedrock EditionJava Edition
File extension.mcstructure.nbt
CompressionNoneGzip
EndiannessLittle-endianBig-endian
Uncompressed file sizeSmaller as the order of blocks hardcoded, only palette indexes savedLarger as each block is stored as (location, palette index, optional NBT)
Compressed file sizeLarger as no compression is usedSmaller as the use of Gzip compression outperforms the more compact .mcstructure format.

NBT Editors ​

You can find download links for some NBT editors here.


Original Credit

Contributors

Edit .mcstructure on GitHub

Bedrock Wiki by Bedrock OSS

"Minecraft" is a trademark of Mojang AB.

Bedrock OSS, Bedrock Wiki and bedrock.dev are not affiliated in any way with Microsoft or Mojang AB.

  • Privacy Policy
  • Join our Discord
  • Learn how to Contribute
  • Visit our Repository