minecraft:behavior.harvest_farm_block for you with a switch.Get GodCraftOverview
minecraft:behavior.harvest_farm_block is an entity component: it goes in the components object of a custom mob, or in one of its component groups. AI goal that makes the mob harvest grown crops and plant seeds from its inventory on empty farmland, like farmer villagers. Needs minecraft:inventory and a navigation component.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
max_seconds_before_search | number | 1 | Longest random wait in seconds before the first search for farmland. |
search_cooldown_max_seconds | number | 8 | Longest random wait in seconds before searching again after finding nothing. |
seconds_until_new_task | number | 0.5 | Seconds to rest after harvesting or planting before the goal can start again. |
search_range | integer | 16 | How far sideways, in blocks, the mob looks for farmland. |
search_height | integer | 1 | How far up and down, in blocks, the mob looks for farmland. |
goal_radius | number | 1.5 | How close the mob must get to the farmland to count as arrived. |
search_count | integer | 0 | How many random blocks are checked each tick. 0 checks every block in range.Range: 0 to … |
speed_multiplier | number | 0.5 | Speed multiplier while moving to the farmland.Range: 0 to … |
priority | integer | 0 | Lower numbers run first: when two goals compete, the one with the smaller priority wins.Range: 0 to … |
control_flags | Goal's control flags[] | none | Which body parts this goal takes over (move, look, jump), so goals using the same parts cannot run together. |
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
BP/entities/<name>.json
{
"minecraft:behavior.harvest_farm_block": {
"max_seconds_before_search": 1,
"search_cooldown_max_seconds": 8,
"seconds_until_new_task": 0.5,
"search_range": 16,
"search_height": 1,
"goal_radius": 1.5,
"search_count": 0,
"speed_multiplier": 0.5
}
}