1. Wiki
  2. /Entities
  3. /minecraft:behavior.harvest_farm_block

minecraft:behavior.harvest_farm_block

Don't want to write this by hand? GodCraft sets minecraft:behavior.harvest_farm_block for you with a switch.Get GodCraft

Overview

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

FieldTypeDefaultDescription
max_seconds_before_searchnumber1Longest random wait in seconds before the first search for farmland.
search_cooldown_max_secondsnumber8Longest random wait in seconds before searching again after finding nothing.
seconds_until_new_tasknumber0.5Seconds to rest after harvesting or planting before the goal can start again.
search_rangeinteger16How far sideways, in blocks, the mob looks for farmland.
search_heightinteger1How far up and down, in blocks, the mob looks for farmland.
goal_radiusnumber1.5How close the mob must get to the farmland to count as arrived.
search_countinteger0How many random blocks are checked each tick. 0 checks every block in range.Range: 0 to …
speed_multipliernumber0.5Speed multiplier while moving to the farmland.Range: 0 to …
priorityinteger0Lower numbers run first: when two goals compete, the one with the smaller priority wins.Range: 0 to …
control_flagsGoal's control flags[]noneWhich 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
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more