mcutils:crop
Vanilla crop block behavior.
Registering
Before you can use this component you need to register it.
js
import { system } from "@minecraft/server";
import { CropComponent } from "@lpsmods/mc-utils";
system.beforeEvents.startup.subscribe((event) => {
event.blockComponentRegistry.registerCustomComponent(CropComponent.typeId, new CropComponent());
});
Component
Options
Name | Type | Default | Description |
---|---|---|---|
growth_state | string | ||
max_stage | number | 7 |
Examples
Crop
json
{
"format_version": "1.21.100",
"minecraft:block": {
"description": {
"identifier": "wiki:custom_crop",
"states": {
"mcutils:growth": [0, 1, 2, 3, 4, 5, 6, 7]
}
},
"components": {
"mcutils:crop": {
"growth_state": "mcutils:growth",
"max_stage": 7
},
"mcutils:fertilizable": {
"growth_state": "mcutils:growth",
"max_stage": 7
}
}
}
}