Structure Generator - Faith-and-Code-Technologies/mDirt GitHub Wiki

Structures

This page explains how to use the Structure generator in mDirt to add custom structures to your Minecraft datapack.


Creating a New Structure

  1. In the Menu Bar, go to New Element → Structure
  2. The main area will update with fields for configuring your structure.

Filling Out the Fields

Name

  • The internal ID for your structure (e.g., ruby_vein)
  • Must:
    • Be all lowercase
    • Contain no spaces
    • Use underscores (_) between words

Structure

  • Upload the .nbt file of your custom structure.
  • This should be exported from Minecraft using the /structure save command or structure block.

Step

Defines when in world generation your structure will spawn. Options:

  • RAW_GENERATION — Small End islands
  • LAKES — Lava lakes
  • LOCAL_MODIFICATIONS — Amethyst geodes, icebergs
  • UNDERGROUND_STRUCTURES — Dungeons, overworld fossils
  • SURFACE_STRUCTURES — Desert wells, ice patches
  • STRONGHOLDS — Not used in vanilla
  • UNDERGROUND_ORES — Ore veins, gravel/dirt/clay disks
  • UNDERGROUND_DECORATION — Infested blocks, Nether ores
  • FLUID_SPRINGS — Lavafalls and waterfalls
  • VEGETAL_DECORATION — Trees, bamboo, kelp, etc.
  • TOP_LAYER_MODIFICATION — Surface freezing

Terrain Adaptation

Determines how the structure adapts to the terrain. Options:

  • none — No terrain adaptation
  • beard_thin — Used by Pillager outposts, villages
  • beard_box — Used by Ancient cities
  • bury — Used by Strongholds
  • encapsulate — Used by Trial Chambers

Start Height

  • Sets the vertical placement of the structure using an offset.
  • This offset is relative to the selected heightmap below.

Project Start to Heightmap

  • Choose a heightmap to project the Start Height against.
  • Examples:
    • WORLD_SURFACE
    • OCEAN_FLOOR
    • MOTION_BLOCKING
    • MOTION_BLOCKING_NO_LEAVES

Spacing

  • The average distance between two attempts to generate the structure.
  • Higher values = rarer structures.

Separation

  • The minimum number of chunks between two structure spawn attempts.
  • Must be strictly less than Spacing.

Biomes

  • A list of biomes where this structure can generate.
  • Shown as a set of checkboxes in the UI.
  • You can check as many as you'd like — mDirt will only generate this structure in the selected biomes.
  • Examples include:
    • Plains
    • Desert
    • Savanna