mcutils:sapling
Vanilla sapling block behavior.
Registering
Before you can use this component you need to register it.
js
import { system } from "@minecraft/server";
import { SaplingComponent } from "@lpsmods/mc-utils";
system.beforeEvents.startup.subscribe((event) => {
event.blockComponentRegistry.registerCustomComponent(SaplingComponent.typeId, new SaplingComponent());
});
Component
Options
Name | Type | Default | Description |
---|---|---|---|
growth_state | string | ||
max_stage | string | 2 | |
feature | string | minecraft:oak_tree_feature |
Examples
Sapling
json
{
"format_version": "1.21.100",
"minecraft:block": {
"description": {
"identifier": "wiki:custom_sapling",
"states": {
"mcutils:age_bit": [0, 1]
}
},
"components": {
"mcutils:sapling": {
"feature": "minecraft:oak_tree_feature"
},
"mcutils:fertilizable": {
"growth_state": "mcutils:age_bit",
"max_stage": 1
}
}
}
}