Skip to main content
Version: 26.3

Biome Hooks

dev.architectury.hooks.level.biome.BiomeHooks

Read a biome's properties through a cross-platform view.

BiomeProperties properties = BiomeHooks.getBiomeProperties(biome);

BiomeProperties

dev.architectury.hooks.level.biome.BiomeProperties groups a biome's settings into four categories:

AccessorReturns
getClimateProperties()Temperature, downfall, precipitation.
getEffectsProperties()Colors (water, foliage, grass) and modifiers.
getGenerationProperties()Carvers and placed features.
getSpawnProperties()Mob spawn entries and costs.

Each category also has a Mutable sub-interface for changing it. You don't usually construct these yourself - you receive a BiomeProperties.Mutable inside a Biome Modification callback. This page documents what that mutable view exposes.

ClimateProperties.Mutable

properties.getClimateProperties()
.setTemperature(0.8f)
.setDownfall(0.4f)
.setHasPrecipitation(true);

Read with getTemperature(), getDownfall(), hasPrecipitation(), getTemperatureModifier(); write with setTemperature, setDownfall, setHasPrecipitation, setTemperatureModifier.

EffectsProperties.Mutable

properties.getEffectsProperties()
.setWaterColor(0x3F76E4)
.setGrassColorOverride(0x80B497);

Set setWaterColor, setFoliageColorOverride, setDryFoliageColorOverride, setGrassColorOverride, and setGrassColorModifier. Each has a matching getter.

GenerationProperties.Mutable

properties.getGenerationProperties()
.addFeature(GenerationStep.Decoration.VEGETAL_DECORATION, myPlacedFeature)
.addCarver(myCarver);
  • addFeature(decoration, Holder/ResourceKey) / removeFeature(decoration, ResourceKey)
  • addCarver(Holder/ResourceKey) / removeCarver(ResourceKey)
  • Read with getFeatures(), getFeatures(decoration), getCarvers().
Changed in 22.0

Carvers are now typed as WorldCarver rather than ConfiguredWorldCarver<?>, following the Minecraft 26.3 rename. Every carver method on this interface changed accordingly.

SpawnProperties.Mutable

properties.getSpawnProperties()
.addSpawn(MobCategory.CREATURE, new MobSpawnSettings.SpawnerData(MyEntities.DEER.get(), 10, 2, 4), 10);
  • addSpawn(category, SpawnerData, weight) / removeSpawns(predicate)
  • setCreatureProbability(float)
  • setSpawnCost(entityType, cost) / setSpawnCost(entityType, charge, energyBudget) / clearSpawnCost(entityType)
note

To actually apply these changes to biomes, use Biome Modifications - it hands your callback the BiomeProperties.Mutable shown here.

Reading spawns off a biome directly

In Minecraft 26.3 a biome's natural mob spawns and its world gen creature spawn probability are stored as environment attributes rather than on the biome itself. BiomeHooks exposes them:

MobSpawnSettings spawns = BiomeHooks.extractMobSpawnSettings(biome);
float probability = BiomeHooks.extractCreatureProbability(biome);

Both were added in Architectury API 22.0, and replace the vanilla Biome#getMobSettings() and MobSpawnSettings#getCreatureProbability() calls that no longer exist.