CropComponent Class
Makes this block behave like Crops
Extends
Parameters
Name | Type | Default | Description |
---|---|---|---|
stateName | String | morefood:stage | The name of the growth state |
maxStage | Number | 7 | The max growth stage |
Methods
onPlayerInteract
onRandomTick
canGrow
getGrowthAmount
applyGrowth
grow
Example
js
new CropComponent("stage", 7);
json
{
"format_version": "1.21.20",
"minecraft:block": {
"description": {
"identifier": "wiki:custom_crop"
},
"component": {
"minecraft:custom_components": ["morefood:crop"]
}
}
}