跳转至

Sea pickle feature

As the name suggests, the sea_pickle feature generates sea pickles in the ocean.

Configuration

The sea_pickle feature only has a count IntProvider option. It determines the max amount of sea pickles per placement.

In code, the CountConfiguration 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 SEA_PICKLE = registerConfiguredFeature(
        "sea_pickle",
        Feature.SEA_PICKLE,
        CountConfiguration(20)
    )

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

    val SEA_PICKLE = placedFeature("sea_pickle", ConfiguredFeatures.SEA_PICKLE)
        .rarityFilter(16) 
        .inSquareSpread() 
        .moveToTopSolid() 
        .biomeFilter() 
        .register()

}
configured_feature/sea_pickle.json
{
  "type": "minecraft:sea_pickle",
  "config": {
    "count": 20
  }
}
placed_feature/sea_pickle.json
{
  "feature": "minecraft:sea_pickle",
  "placement": [
    {
      "type": "minecraft:rarity_filter",
      "chance": 16 
    },
    {
      "type": "minecraft:in_square" 
    },
    {
      "type": "minecraft:heightmap",
      "heightmap": "OCEAN_FLOOR_WG" 
    },
    {
      "type": "minecraft:biome" 
    }
  ]
}

Example