-
Notifications
You must be signed in to change notification settings - Fork 0
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.
- 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
- Annotation processing: The framework scans fields annotated with biome generation annotations
- Feature configuration: Extracts feature parameters from annotation values
- Biome modification: Applies features to specified biome tags
- Data generation: During data generation, feature files are automatically generated
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");@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)
@GenerateOre.Placement:
-
rarity(optional, default:OreRarity.COMMON): Ore rarity (COMMONorRARE) -
count(required): Number of ore veins per chunk -
shape(optional, default:OrePlacementShape.UNIFORM): Distribution shape (UNIFORMorTRIANGLE) -
from(required): Minimum Y level for ore generation -
to(required): Maximum Y level for ore generation
@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
-
COMMON: Standard ore frequency (like coal, iron) -
RARE: Reduced ore frequency (like diamond, emerald)
-
UNIFORM: Even distribution across Y levels -
TRIANGLE: More common at middle Y levels, rarer at extremes
-
minecraft:stone_ore_replaceables: Stone blocks -
minecraft:deepslate_ore_replaceables: Deepslate blocks -
minecraft:netherrack_replaceables: Netherrack blocks -
minecraft:sand_replaceables: Sand blocks
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");@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
@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
-
ForkingTrunkPlacer: Creates branching trunks -
StraightTrunkPlacer: Creates straight trunks -
MegaJungleTrunkPlacer: Creates large jungle-style trunks -
DarkOakTrunkPlacer: Creates dark oak-style branching trunks
@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
-
BlobFoliagePlacer: Creates round foliage clusters -
SpruceFoliagePlacer: Creates cone-shaped foliage -
PineFoliagePlacer: Creates pine-style foliage -
AcaciaFoliagePlacer: Creates flat-topped foliage
@GenerateTree.FeatureSize:
-
type(optional, default:TreeFeatureSize.TWO_LAYERED): Size type (TWO_LAYEREDorTHREE_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
-
TWO_LAYERED: Two-layered size calculation -
THREE_LAYERED: Three-layered size calculation
@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
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");@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
@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
@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
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");@GenerateGrass.Configuration:
-
grass(required): Resource location of the grass block -
tries(optional, default:32): Number of placement attempts per chunk
@GenerateGrass.Placement:
-
count(optional, default:5): Number of grass patches to generate
@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
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");-
configuration(required): Class implementingConfiguredFeatureDefinition<?, ?> -
placement(required): Class implementingPlacedFeatureDefinition<?> -
biomeModifier(required): Class implementingBiomeModifierDefinition<?>
-
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
-
minecraft:is_nether: All nether biomes -
minecraft:is_nether_forest: Nether forest biomes
-
minecraft:is_end: All end biomes
-
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
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/
- @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
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.
🚀 Getting Started
🧩 Core Concepts
⚙️ Data Generation
- ⚙️ Advancement
- ⚙️ Damage Type
- ⚙️ Chest Loot Modifier
- ⚙️ Recipe
- ⚙️ Sound
- ⚙️ Jukebox Song
- ⚙️ Enchantment
- ⚙️ Trim Material
- ⚙️ Trim Pattern
- ⚙️ Banner Pattern
- ⚙️ Painting Variant
- ⚙️ Particle Sprite Set
- ⚙️ Wolf Variant
- ⚙️ Item Model
- ⚙️ Block Model
- ⚙️ Block Loot Table
- ⚙️ Tag
- ⚙️ Language Translation
- ⚙️ World Feature
- ⚙️ Custom Properties
🚨 Events
🛠 Engine Layers
🧪 Resources
- 🧪 Examples