mcutils:farmland
Vanilla farmland block behavior.
Registering
Before you can use this component you need to register it.
js
import { system } from "@minecraft/server";
import { FarmlandComponent } from "@lpsmods/mc-utils";
system.beforeEvents.startup.subscribe((event) => {
event.blockComponentRegistry.registerCustomComponent(FarmlandComponent.typeId, new FarmlandComponent());
});
Component
Options
Name | Type | Default | Description |
---|---|---|---|
moisture_state | string | mcutils:moisture | |
block | string | dirt | |
max_moisture | number | 7 | |
moist_block | string | water |
Examples
Farmland
json
{
"format_version": "1.21.100",
"minecraft:block": {
"description": {
"identifier": "wiki:custom_farmland",
"states": {
"mcutils:moisture": { "values": { "min": 0, "max": 7 } }
}
},
"components": {
"mcutils:farmland": {
"moisture_state": "mcutils:moisture"
}
}
}
}