Skip to content

Forest rock feature

The forest_rock feature can be used to generate small 3x3 rocks in the world.

Configuration

Only the block state used for the rocks is configurable:

Option Type Description
state A BlockState The block state to use for the rock.

In code, the BlockStateConfiguration class is used to configure the feature.

Example

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

    val FOREST_ROCK = registerConfiguredFeature(
        "forest_rock",
        Feature.FOREST_ROCK,
        BlockStateConfiguration(Blocks.MOSSY_COBBLESTONE.defaultBlockState())
    )

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

    val FOREST_ROCK = placedFeature("forest_rock", ConfiguredFeatures.FOREST_ROCK)
        .count(2) 
        .inSquareSpread() 
        .moveToMotionBlocking() 
        .biomeFilter() 
        .register()

}
configured_feature/forest_rock.json
{
  "type": "minecraft:forest_rock",
  "config": {
    "state": {
      "Name": "minecraft:mossy_cobblestone"
    }
  }
}
placed_feature/forest_rock.json
{
  "feature": "minecraft:forest_rock",
  "placement": [
    {
      "type": "minecraft:count",
      "count": 2 
    },
    {
      "type": "minecraft:in_square" 
    },
    {
      "type": "minecraft:heightmap",
      "heightmap": "MOTION_BLOCKING" 
    },
    {
      "type": "minecraft:biome" 
    }
  ]
}

Result