minecraft:behavior.work

Allows the NPC to use the POI

Properties

PropertyTypeDefaultWhat it does
sound_delay_minIntegermin 00The min interval in which a sound will play.
sound_delay_maxIntegermin 00The max interval in which a sound will play.
goal_cooldownIntegermin 00The amount of ticks the goal will be on cooldown before it can be used again
active_timeIntegermin 00The amount of ticks the NPC will stay in their the work location
can_work_in_rainBooleanfalseIf true, this entity can work when their jobsite POI is being rained on.
work_in_rain_toleranceIntegermin 0-1If "can_work_in_rain" is false, this is the maximum number of ticks left in the goal where rain will not interrupt the goal
on_arrivalObject{"event": "", "filters": {"AND": null, "NOT": null, "OR":…Event to run when the mob reaches their jobsite.
eventText""
targetTextself, other, player, target, parent, baby, block, damager, holder, item"self"
filtersObject or List of object{"AND": null, "NOT": null, "OR": null, "all": null, "all_…Filters allow data objects to specify test criteria which allows their use. Filters can be defined by a single object of type (Filter Test), an array of tests, collection groups, or a combination of these objects.
testText—The name of the test to apply.
subjectBoolean or Integer or Decimal or Text—The subject of this filter test.
operatorBoolean or Integer or Decimal or Text—The comparison to apply with 'value'.
domainBoolean or Integer or Decimal or Text—The domain the test should be performed in.
valueBoolean or Integer or Decimal or Text—The value being compared with the test.
speed_multiplierDecimal0.5Movement speed multiplier of the mob when using this AI Goal
priorityIntegermin 00
control_flagsList of text[]

Example from the game files

This is how vanilla Villager uses it in Minecraft Bedrock 1.26.60.5:

{
  "minecraft:behavior.work": {
    "priority": 7,
    "active_time": 250,
    "on_arrival": {
      "event": "minecraft:resupply_trades",
      "target": "self"
    },
    "can_work_in_rain": false,
    "speed_multiplier": 0.5,
    "goal_cooldown": 200,
    "sound_delay_max": 200,
    "work_in_rain_tolerance": 100,
    "sound_delay_min": 100
  }
}

Used by 1

Vanilla entities with minecraft:behavior.work in their definition:

Related components