-
Notifications
You must be signed in to change notification settings - Fork 2
NBT Files
NBT files contain the actual structure data - the blocks, entities, and layout of your structure. This page explains where to place them and how to reference them.
NBT structure files are stored in a different location than structure JSON files:
data/<namespace>/structure/<path>/<name>.nbt
Important: This is structure/, NOT worldgen/structure/!
Example: data/mvs/structure/carts/cart.nbt
- Build your structure in Minecraft (creative mode recommended)
-
Place a Structure Block (obtain with
/give @s structure_block) -
Set the structure block:
- Mode: Save
- Structure Name: Your structure name (e.g.,
cart) - Relative Position: Set corner positions
- Size: Adjust to fit your structure
- Save the structure by clicking "Save"
-
Export the structure:
- The NBT file is saved to your world's
generated/structures/folder - Copy it to your datapack's
data/<namespace>/structure/folder
- The NBT file is saved to your world's
Structure Name:
- Use lowercase with underscores:
cart,barn,mineshaft_entrance - This becomes part of the resource location
Relative Position:
- Set the two opposite corners of your structure
- Structure block shows a preview outline
Size Limits:
- Maximum 48×48×48 blocks per structure
- For larger structures, use jigsaw connections
After saving in a structure block:
- Navigate to your world save folder
- Go to
generated/structures/<namespace>/<name>.nbt - Copy the file to your datapack:
data/<namespace>/structure/<name>.nbt
Example:
- World save:
saves/MyWorld/generated/structures/mvs/cart.nbt - Datapack:
datapacks/my_pack/data/mvs/structure/carts/cart.nbt
In template pool JSON files, reference NBT files using resource locations:
{
"location": "namespace:path/to/structure"
}Important Rules:
-
No
.nbtextension - Don't include.nbtin the path -
Use forward slashes - Use
/not\ - Match directory structure - Path should match folder structure
File: data/mvs/structure/carts/cart.nbt
Reference: "mvs:carts/cart"
File: data/mvs/structure/houses/barn.nbt
Reference: "mvs:houses/barn"
File: data/mvs/structure/mineshaft/entrance.nbt
Reference: "mvs:mineshaft/entrance"
Template Pool: data/mvs/worldgen/template_pool/carts/cart/start_pool.json
{
"name": "mvs:cart/start_pool",
"fallback": "minecraft:empty",
"elements": [
{
"weight": 1,
"element": {
"location": "mvs:carts/cart",
"processors": "minecraft:empty",
"projection": "rigid",
"element_type": "minecraft:single_pool_element"
}
}
]
}The "location": "mvs:carts/cart" references data/mvs/structure/carts/cart.nbt.
-
cart.nbt- Simple, clear -
barn.nbt- Descriptive -
mineshaft_entrance.nbt- Descriptive with context -
large_cart_1.nbt- Variant with number
-
Cart.nbt- Use lowercase -
cart structure.nbt- No spaces -
cart.nbt.nbt- No double extension -
cart_v2_final.nbt- Keep names simple
For jigsaw structures, you need multiple NBT files that connect together:
In your NBT files, place Jigsaw Blocks to define connection points:
- Place a Jigsaw Block where you want connections
-
Set Jigsaw Block properties:
-
Name: The pool to connect to (e.g.,
mvs:mineshaft/straight) -
Target: The jigsaw block name in target pieces (e.g.,
mineshaft_entrance) -
Joint:
rollableoraligned(usuallyrollable)
-
Name: The pool to connect to (e.g.,
Entrance piece (entrance.nbt):
- Contains jigsaw blocks with:
- Name:
mvs:mineshaft/straight - Target:
mineshaft_entrance
- Name:
Straight piece (straight_1.nbt):
- Contains jigsaw blocks with:
- Name:
mvs:mineshaft/straight(connects to more straights) - Target:
mineshaft_entrance(connects back to entrance)
- Name:
- Also has jigsaw blocks for intersections, dead ends, etc.
Name field: References the template pool
-
mvs:mineshaft/straight→ Pool atdata/mvs/worldgen/template_pool/mineshaft/straight.json
Target field: Matches jigsaw block names in other pieces
-
mineshaft_entrance→ Jigsaw blocks in other pieces with this name
For structures that need different NBT files per Minecraft version, use version-aware pool elements. See Advanced Topics for details.
Problem: Template pool can't find NBT file
Solutions:
- Check file path matches reference exactly
- Verify no
.nbtextension in reference - Ensure file exists in
structure/folder (notworldgen/structure/) - Check namespace matches
Problem: Wrong NBT file loads
Solutions:
- Verify
locationfield matches file path - Check file names are correct
- Ensure no typos in paths
Problem: Jigsaw pieces don't connect
Solutions:
- Verify jigsaw block names match pool names
- Check jigsaw block targets match
- Ensure target pools exist
- Verify jigsaw block properties are set correctly
Next: Learn about Advanced Topics including version-aware structures!