Skip to content

Lake feature

Deprecated

This feature is marked as deprecated in Minecraft's internal code. It might be removed in a future update.

The lake feature can be used to add lakes to a biome (for example the underground lava lakes).

Configuration

The lake feature has the following configuration options:

Option Type Description
fluid A BlockState The fluid block to use for the lake.
barrier A BlockState The block to use for the lake's edge.

In code, the LakeFeature.Configuration class is used to configure the feature.

Example

As an example, here's the configured- and placed feature for the underground lava lakes that can be found in most biomes.

ConfiguredFeatures.kt
@OptIn(ExperimentalWorldGen::class)
@Init(stage = InitStage.POST_PACK_PRE_WORLD)
object ConfiguredFeatures : FeatureRegistry by ExampleAddon.registry {

    val LAKE_LAVA = registerConfiguredFeature(
        "lake_lava",
        Feature.LAKE,
        LakeFeature.Configuration(
            BlockStateProvider.simple(Blocks.LAVA.defaultBlockState()), 
            BlockStateProvider.simple(Blocks.STONE.defaultBlockState()) 
        )
    )

}
PlacedFeatures.kt
@OptIn(ExperimentalWorldGen::class)
@Init(stage = InitStage.POST_PACK_PRE_WORLD)
object PlacedFeatures : FeatureRegistry by ExampleAddon.registry {

    val LAKE_LAVA_UNDERGROUND = placedFeature("lake_lava_underground", ConfiguredFeatures.LAKE_LAVA)
        .rarityFilter(9) 
        .inSquareSpread() 
        .heightRangeUniform(VerticalAnchor.absolute(0), VerticalAnchor.top()) 
        .environmentScan( 
            Direction.DOWN,
            BlockPredicate.allOf(BlockPredicate.not(BlockPredicate.ONLY_IN_AIR_PREDICATE), BlockPredicate.insideWorld(BlockPos(0, -5, 0))),
            32
        )
        .surfaceRelativeThresholdFilter(Heightmap.Types.OCEAN_FLOOR_WG, Int.MIN_VALUE, -5) 
        .biomeFilter() 
        .register()

}
configured_feature/lake_lava.json
{
  "type": "minecraft:lake",
  "config": {
    "fluid": {
      "type": "minecraft:simple_state_provider",
      "state": {
        "Name": "minecraft:lava",
        "Properties": {
          "level": "0"
        }
      }
    },
    "barrier": {
      "type": "minecraft:simple_state_provider",
      "state": {
        "Name": "minecraft:stone"
      }
    }
  }
}
placed_feature/lake_lava_underground.json
{
  "feature": "minecraft:lake_lava",
  "placement": [
    {
      "type": "minecraft:rarity_filter",
      "chance": 9 
    },
    {
      "type": "minecraft:in_square" 
    },
    {
      "type": "minecraft:height_range", 
      "height": {
        "type": "minecraft:uniform",
        "max_inclusive": {
          "below_top": 0
        },
        "min_inclusive": {
          "absolute": 0
        }
      }
    },
    {
      "type": "minecraft:environment_scan", 
      "direction_of_search": "down",
      "max_steps": 32,
      "target_condition": {
        "type": "minecraft:all_of",
        "predicates": [
          {
            "type": "minecraft:not",
            "predicate": {
              "type": "minecraft:matching_blocks",
              "blocks": "minecraft:air"
            }
          },
          {
            "type": "minecraft:inside_world_bounds",
            "offset": [
              0,
              -5,
              0
            ]
          }
        ]
      }
    },
    {
      "type": "minecraft:surface_relative_threshold_filter", 
      "heightmap": "OCEAN_FLOOR_WG",
      "max_inclusive": -5
    },
    {
      "type": "minecraft:biome" 
    }
  ]
}

Result

Example