minecraft:behavior.harvest_farm_block
Allows the entity to search within an area for farmland with air above it. If found, the entity will replace the air block by planting a seed item from its inventory on the farmland block. This goal requires "minecraft:inventory" and "minecraft:navigation" to execute. This goal will not execute if the entity does not have an item in its inventory.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
max_seconds_before_search | Decimal | 1 | The maximum amount of time in seconds that the goal can take before searching for the first harvest block. The time is chosen between 0 and this number. |
search_cooldown_max_seconds | Decimal | 8 | The maximum amount of time in seconds that the goal can take before searching again, after failing to find a a harvest block already. The time is chosen between 0 and this number. |
seconds_until_new_task | Decimal | 0.5 | The amount of time in seconds that the goal will cooldown after a successful reap/sow, before it can start again. |
search_range | Integer | 16 | The distance in blocks the entity will search within to find a valid target position. |
search_height | Integer | 1 | The height in blocks the entity will search within to find a valid target position. |
goal_radius | Decimal | 1.5 | Distance in blocks within the entity considers it has reached it's target position. |
search_count | Integermin 0 | 0 | The number of randomly selected blocks each tick that the mob will check within its search range and height for a valid block to move to. A value of 0 will have the mob check every block within range in one tick. |
speed_multiplier | Decimalmin 0 | 0.5 | Movement speed multiplier of the mob when using this goal. |
priority | Integermin 0 | 0 | |
control_flags | List of text | [] |
Example from the game files
This is how vanilla Villager uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:behavior.harvest_farm_block": {
"priority": 9,
"speed_multiplier": 0.5
}
}Used by 2
Vanilla entities with minecraft:behavior.harvest_farm_block in their definition:
Related components
behavior.pickup_itemsbehavior.move_to_villagebehavior.lay_eggbehavior.move_indoorsbehavior.move_outdoorsbehavior.place_blockbehavior.raid_gardenbehavior.digbehavior.dragonscanningbehavior.drop_item_forbehavior.eat_blockbehavior.eat_carried_itembehavior.eat_mobbehavior.fertilize_farm_blockbehavior.hold_groundbehavior.inspect_bookshelfbehavior.move_through_villagebehavior.open_doorbehavior.random_search_and_digbehavior.restrict_open_doorbehavior.snackingbehavior.stroll_towards_villagebehavior.take_blockbehavior.transport_items