Skip to content

World Feature Data Generation

Maksym Uimanov edited this page Feb 12, 2026 · 1 revision

World Feature Data Generation

The Temporal API provides a comprehensive set of annotations for automatically generating biome features during data generation. These annotations eliminate the need for manual JSON feature file creation by programmatically registering ore veins, trees, flowers, grass, and custom world features for biomes.

Responsibilities / Purpose

  • Automates feature generation: Generates biome feature JSON files without manual asset creation
  • Supports multiple feature types: Covers ores, trees, flowers, grass, and custom features
  • Integrates with data generation: Works seamlessly with NeoForge's data generation system
  • Enables world generation: Provides hooks into Minecraft's world generation systems

How it works

  1. Annotation processing: The framework scans fields annotated with biome generation annotations
  2. Feature configuration: Extracts feature parameters from annotation values
  3. Biome modification: Applies features to specified biome tags
  4. Data generation: During data generation, feature files are automatically generated

Ore Generation

@GenerateOre

Generates ore veins in specified biomes with configurable distribution patterns.

@GenerateOre(
    configuration = @GenerateOre.Configuration(
        ore = "example:example_ore",
        replaceableBlocks = "minecraft:sand",
        replaceableBlocksTag = "minecraft:stone_ore_replaceables",
        size = 17
    ),
    placement = @GenerateOre.Placement(
        count = 20,
        shape = OrePlacementShape.TRIANGLE,
        from = 16,
        to = 64
    ),
    biomeModifier = @GenerateOre.BiomeModifier(
        biomeTag = "minecraft:is_overworld"
    )
)
public static final ResourceKey<ConfiguredFeature<?, ?>> EXAMPLE_ORE_FEATURE = ResourceUtils.createKey(Registries.CONFIGURED_FEATURE, "example_ore_feature");

Configuration Parameters

@GenerateOre.Configuration:

  • ore (required): Resource location of the ore block
  • replaceableBlocks (optional, default: {}): Array of blocks that can be replaced by the ore
  • replaceableBlocksTag (optional, default: ""): Tag of blocks that can be replaced by the ore
  • blockTagContainer (optional, default: Object.class): Tag container class for block tags
  • size (optional, default: 1): Size of ore veins (number of blocks per vein)
  • discardChanceOnAirExposure (optional, default: 0.0F): Chance to discard ore when exposed to air (0.0-1.0)

Placement Parameters

@GenerateOre.Placement:

  • rarity (optional, default: OreRarity.COMMON): Ore rarity (COMMON or RARE)
  • count (required): Number of ore veins per chunk
  • shape (optional, default: OrePlacementShape.UNIFORM): Distribution shape (UNIFORM or TRIANGLE)
  • from (required): Minimum Y level for ore generation
  • to (required): Maximum Y level for ore generation

Biome Modifier Parameters

@GenerateOre.BiomeModifier:

  • biomeTag (optional, default: "minecraft:is_overworld"): Tag of biomes where ore generates
  • biomeTagContainer (optional, default: Object.class): Tag container class for biome tags

Ore Rarity Values

  • COMMON: Standard ore frequency (like coal, iron)
  • RARE: Reduced ore frequency (like diamond, emerald)

Placement Shape Values

  • UNIFORM: Even distribution across Y levels
  • TRIANGLE: More common at middle Y levels, rarer at extremes

Common Replaceable Block Tags

  • minecraft:stone_ore_replaceables: Stone blocks
  • minecraft:deepslate_ore_replaceables: Deepslate blocks
  • minecraft:netherrack_replaceables: Netherrack blocks
  • minecraft:sand_replaceables: Sand blocks

Tree Generation

@GenerateTree

Generates trees in specified biomes with configurable trunk, foliage, and placement parameters.

@GenerateTree(
    configuration = @GenerateTree.Configuration(
        log = "example:example_log",
        leaves = "example:example_leaves",
        root = "minecraft:grass_block",
        trunk = @GenerateTree.Trunk(
            trunkPlacerClass = ForkingTrunkPlacer.class,
            baseHeight = 5,
            heightRandA = 3,
            heightRandB = 0
        ),
        foliage = @GenerateTree.Foliage(
            foliagePlacerClass = BlobFoliagePlacer.class,
            radius = 3,
            offset = 1,
            height = 2
        ),
        featureSize = @GenerateTree.FeatureSize(
            type = TreeFeatureSize.TWO_LAYERED,
            limit = 2,
            lowerSize = 1,
            upperSize = 2
        ),
        ignoreVines = true
    ),
    placement = @GenerateTree.Placement(
        sapling = "example:example_sapling",
        baseValue = 1,
        chance = 1,
        addedAmount = 0
    ),
    biomeModifier = @GenerateTree.BiomeModifier(
        biomeTag = "minecraft:is_forest"
    )
)
public static final ResourceKey<ConfiguredFeature<?, ?>> EXAMPLE_TREE_FEATURE = ResourceUtils.createKey(Registries.CONFIGURED_FEATURE, "example_tree_feature");

Configuration Parameters

@GenerateTree.Configuration:

  • log (required): Resource location of the log block
  • leaves (required): Resource location of the leaves block
  • root (optional, default: "minecraft:grass_block"): Root block for tree placement
  • trunk (required): Trunk configuration
  • foliage (required): Foliage configuration
  • featureSize (required): Tree size configuration
  • ignoreVines (optional, default: true): Whether to ignore vines during generation

Trunk Parameters

@GenerateTree.Trunk:

  • trunkPlacerClass (optional, default: ForkingTrunkPlacer.class): Trunk placer class
  • baseHeight (required): Base height of the trunk
  • heightRandA (required): Random height variation A
  • heightRandB (required): Random height variation B

Common Trunk Placer Classes

  • ForkingTrunkPlacer: Creates branching trunks
  • StraightTrunkPlacer: Creates straight trunks
  • MegaJungleTrunkPlacer: Creates large jungle-style trunks
  • DarkOakTrunkPlacer: Creates dark oak-style branching trunks

Foliage Parameters

@GenerateTree.Foliage:

  • foliagePlacerClass (optional, default: BlobFoliagePlacer.class): Foliage placer class
  • radius (required): Radius of foliage
  • offset (required): Vertical offset from trunk
  • height (required): Height of foliage

Common Foliage Placer Classes

  • BlobFoliagePlacer: Creates round foliage clusters
  • SpruceFoliagePlacer: Creates cone-shaped foliage
  • PineFoliagePlacer: Creates pine-style foliage
  • AcaciaFoliagePlacer: Creates flat-topped foliage

Feature Size Parameters

@GenerateTree.FeatureSize:

  • type (optional, default: TreeFeatureSize.TWO_LAYERED): Size type (TWO_LAYERED or THREE_LAYERED)
  • limit (required): Height limit for size calculation
  • upperLimit (optional, default: 0): Upper height limit
  • lowerSize (required): Size for lower section
  • middleSize (optional, default: 0): Size for middle section
  • upperSize (required): Size for upper section
  • minClippedHeight (optional, default: 0): Minimum clipped height

Feature Size Types

  • TWO_LAYERED: Two-layered size calculation
  • THREE_LAYERED: Three-layered size calculation

Placement Parameters

@GenerateTree.Placement:

  • sapling (required): Resource location of the sapling item
  • baseValue (required): Base value for tree density calculation
  • chance (required): Chance for tree to generate (1 = always, higher = rarer)
  • addedAmount (required): Additional amount for density calculation

Flower Generation

@GenerateFlower

Generates flowers in specified biomes with configurable noise-based distribution and multiple flower types.

@GenerateFlower(
    configuration = @GenerateFlower.Configuration(
        flower = "example:example_flower",
        tries = 64,
        xzSpread = 6,
        ySpread = 2,
        noiseSeed = 0,
        noiseScale = 0.005F,
        noiseThreshold = -0.8F,
        noiseHighChance = 0.33333334F,
        firstOctave = 0,
        amplitudes = {1.0D},
        lowStateFlowers = "minecraft:dandelion",
        highStateFlowers = "minecraft:dandelion"
    ),
    placement = @GenerateFlower.Placement(
        chance = 32,
        noiseLevel = -0.8F,
        belowNoise = 15,
        aboveNoise = 4
    ),
    biomeModifier = @GenerateFlower.BiomeModifier(
        biomeTag = "minecraft:is_forest"
    )
)
public static final ResourceKey<ConfiguredFeature<?, ?>> EXAMPLE_FLOWER_FEATURE = ResourceUtils.createKey(Registries.CONFIGURED_FEATURE, "example_flower_feature");

Configuration Parameters

@GenerateFlower.Configuration:

  • flower (required): Resource location of the primary flower block
  • tries (optional, default: 64): Number of placement attempts per chunk
  • xzSpread (optional, default: 6): Horizontal spread radius
  • ySpread (optional, default: 2): Vertical spread radius
  • noiseSeed (optional, default: 0): Seed for noise generation
  • noiseScale (optional, default: 0.005F): Scale factor for noise
  • noiseThreshold (optional, default: -0.8F): Threshold for noise-based placement
  • noiseHighChance (optional, default: 0.33333334F): Chance of high state flowers
  • firstOctave (optional, default: 0): First octave for noise generation
  • amplitudes (optional, default: {1.0D}): Amplitude array for noise octaves
  • lowStateFlowers (required): Array of flowers for low noise states
  • highStateFlowers (required): Array of flowers for high noise states

Placement Parameters

@GenerateFlower.Placement:

  • chance (optional, default: 32): Chance for flower patch to generate
  • noiseLevel (optional, default: -0.8F): Noise level threshold
  • belowNoise (optional, default: 15): Flower count below noise threshold
  • aboveNoise (optional, default: 4): Flower count above noise threshold

Biome Modifier Parameters

@GenerateFlower.BiomeModifier:

  • biomeTag (optional, default: "minecraft:is_overworld"): Tag of biomes where flowers generate
  • biomeTagContainer (optional, default: Object.class): Tag container class for biome tags

Grass Generation

@GenerateGrass

Generates grass patches in specified biomes with simple configuration.

@GenerateGrass(
    configuration = @GenerateGrass.Configuration(
        grass = "example:example_grass"
    ),
    placement = @GenerateGrass.Placement(
        count = 5
    ),
    biomeModifier = @GenerateGrass.BiomeModifier(
        biomeTag = "minecraft:is_taiga"
    )
)
public static final ResourceKey<ConfiguredFeature<?, ?>> EXAMPLE_GRASS_FEATURE = ResourceUtils.createKey(Registries.CONFIGURED_FEATURE, "example_grass_feature");

Configuration Parameters

@GenerateGrass.Configuration:

  • grass (required): Resource location of the grass block
  • tries (optional, default: 32): Number of placement attempts per chunk

Placement Parameters

@GenerateGrass.Placement:

  • count (optional, default: 5): Number of grass patches to generate

Biome Modifier Parameters

@GenerateGrass.BiomeModifier:

  • biomeTag (optional, default: "minecraft:is_overworld"): Tag of biomes where grass generates
  • biomeTagContainer (optional, default: Object.class): Tag container class for biome tags

Custom World Features

@GenerateWorldFeature

Generates custom world features using fully configurable feature definitions.

@GenerateWorldFeature(
    configuration = CustomFeatureConfiguration.class,
    placement = CustomFeaturePlacement.class,
    biomeModifier = CustomBiomeModifier.class
)
public static final ResourceKey<ConfiguredFeature<?, ?>> CUSTOM_FEATURE = ResourceUtils.createKey(Registries.CONFIGURED_FEATURE, "custom_feature");

Parameters

  • configuration (required): Class implementing ConfiguredFeatureDefinition<?, ?>
  • placement (required): Class implementing PlacedFeatureDefinition<?>
  • biomeModifier (required): Class implementing BiomeModifierDefinition<?>

Common Biome Tags

Overworld Biomes

  • minecraft:is_overworld: All overworld biomes
  • minecraft:is_ocean: Ocean biomes
  • minecraft:is_mountain: Mountain biomes
  • minecraft:is_forest: Forest biomes
  • minecraft:is_taiga: Taiga biomes
  • minecraft:is_desert: Desert biomes
  • minecraft:is_savanna: Savanna biomes
  • minecraft:is_jungle: Jungle biomes
  • minecraft:is_swamp: Swamp biomes
  • minecraft:is_badlands: Badlands biomes

Nether Biomes

  • minecraft:is_nether: All nether biomes
  • minecraft:is_nether_forest: Nether forest biomes

End Biomes

  • minecraft:is_end: All end biomes

Climate-based Tags

  • minecraft:is_hot: Hot biomes
  • minecraft:is_cold: Cold biomes
  • minecraft:is_snowy: Snowy biomes
  • minecraft:is_wet: Wet biomes
  • minecraft:is_dry: Dry biomes

Feature File Locations

Generated feature files are placed in specific data locations:

  • Configured Features: data/modid/worldgen/configured_feature/
  • Placed Features: data/modid/worldgen/placed_feature/
  • Biome Modifiers: data/modid/neoforge/biome_modifier/

When to use

  • @GenerateOre: Mineral deposits, gem veins, custom ore generation
  • @GenerateTree: Custom trees, biome-specific vegetation, forest generation
  • @GenerateFlower: Flower patches, biome-specific flora, decorative vegetation
  • @GenerateGrass: Grass patches, ground cover, simple vegetation
  • @GenerateWorldFeature: Complex custom features, specialized generation logic

Extension Points

The annotation system integrates with Temporal API's metadata processing:

  • Automatic file generation: Creates appropriate feature JSON files
  • Biome modification: Applies features to specified biome tags
  • Noise integration: Supports noise-based distribution for natural patterns
  • Custom feature support: Allows fully custom feature definitions
  • Cross-mod compatibility: Works with NeoForge's biome modification system

Each annotation maps to a specific feature registration strategy that handles the world generation logic, allowing for easy extension and customization of the biome generation system.

Clone this wiki locally