SaplingComponent Class
Makes this block behave like a Sapling
Extends
Parameters
Name | Type | Default | Description |
---|---|---|---|
generator | SaplingGenerator | The feature to generate a tree | |
stateName | String | morefood:stage | The name of the growth state |
Methods
onPlayerInteract
onRandomTick
generate
canGrow
grow
Example
js
var generator = new SaplingGenerator(
undefined,
undefined,
undefined,
new ConfiguredFeature("morefoodtree:apple_tree"),
undefined,
undefined,
undefined
);
new SaplingComponent(generator, "stage");
json
{
"format_version": "1.21.20",
"minecraft:block": {
"description": {
"identifier": "wiki:custom_sapling_block"
},
"component": {
"minecraft:custom_components": ["wiki:custom_sapling"]
}
}
}