Bamboo feature
The bamboo
feature is used to add bamboo to the world.
Configuration
Bamboo features can only be configured to have a specific probability of spawning a podzol disk under the bamboo.
Option | Type | Description |
---|---|---|
probability | A float in the range | Determines the probability of spawning a podzol disk under the bamboo. |
In code, the configuration is done via the ProbabilityFeatureConfiguration
class.
Example
As an example, here's the configured and placed feature for the bamboo in the jungle.
ConfiguredFeatures.kt
@OptIn(ExperimentalWorldGen::class)
@Init(stage = InitStage.POST_PACK_PRE_WORLD)
object ConfiguredFeatures : FeatureRegistry by ExampleAddon.registry {
val BAMBOO_SOME_PODZOL = registerConfiguredFeature(
"bamboo_some_podzol",
Feature.BAMBOO,
ProbabilityFeatureConfiguration(0.2f)
)
}
PlacedFeatures.kt
@OptIn(ExperimentalWorldGen::class)
@Init(stage = InitStage.POST_PACK_PRE_WORLD)
object PlacedFeatures: FeatureRegistry by ExampleAddon.registry {
val BAMBOO_SOME_PODZOL = placedFeature("bamboo_some_podzol", ConfiguredFeatures.BAMBOO_SOME_PODZOL)
.noiseBasedCount(170, 80.0, 0.3)
.inSquareSpread()
.moveToWorldSurface()
.biomeFilter()
.register()
}
configured_feature/bamboo_some_podzol.json
"type": "minecraft:bamboo",
"config": {
"probability": 0.2
}
placed_feature/bamboo.json
{
"feature": "minecraft:bamboo_some_podzol",
"placement": [
{
"type": "minecraft:noise_based_count",
"noise_factor": 80.0,
"noise_offset": 0.3,
"noise_to_count_ratio": 160
},
{
"type": "minecraft:in_square"
},
{
"type": "minecraft:heightmap",
"heightmap": "WORLD_SURFACE_WG"
},
{
"type": "minecraft:biome"
}
]
}
Result