minecraft:behavior.work_composter
Allows the NPC to use the composter POI to convert excess seeds into bone meal.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
use_block_min | Integermin 0 | 100 | The minimum interval in which the mob will interact with the composter. |
use_block_max | Integermin 0 | 200 | The maximum interval in which the mob will interact with the composter. |
items_per_use_max | Integermin 0 | 20 | The maximum number of items which can be added to the composter per block interaction. |
block_interaction_max | Integermin 0 | 1 | The maximum number of times the mob will interact with the composter. |
can_fill_composter | Boolean | true | Determines whether the mob can add items to a composter given that it is not full. |
can_empty_composter | Boolean | true | Determines whether the mob can empty a full composter. |
min_item_count | Integer | 10 | Limits the amount of each compostable item the mob can use. Any amount held over this number will be composted if possible |
goal_cooldown | Integermin 0 | 0 | The amount of ticks the goal will be on cooldown before it can be used again |
active_time | Integermin 0 | 0 | The amount of ticks the NPC will stay in their the work location |
can_work_in_rain | Boolean | false | If true, this entity can work when their jobsite POI is being rained on. |
work_in_rain_tolerance | Integermin 0 | -1 | If "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_arrival | Object | {"event": "", "filters": {"AND": null, "NOT": null, "OR":… | Event to run when the mob reaches their jobsite. |
event | Text | "" | |
target | Textself, other, player, target, parent, baby, block, damager, holder, item | "self" | |
filters | Object 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. |
test | Text | — | The name of the test to apply. |
subject | Boolean or Integer or Decimal or Text | — | The subject of this filter test. |
operator | Boolean or Integer or Decimal or Text | — | The comparison to apply with 'value'. |
domain | Boolean or Integer or Decimal or Text | — | The domain the test should be performed in. |
value | Boolean or Integer or Decimal or Text | — | The value being compared with the test. |
speed_multiplier | Decimal | 0.5 | Movement speed multiplier of the mob when using this AI 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.work_composter": {
"active_time": 250,
"priority": 9,
"can_work_in_rain": false,
"on_arrival": {
"event": "minecraft:resupply_trades",
"target": "self"
},
"goal_cooldown": 200,
"speed_multiplier": 0.5,
"work_in_rain_tolerance": 100
}
}Used by 1
Vanilla entities with minecraft:behavior.work_composter in their definition:
Related components
behavior.pickup_itemsbehavior.move_to_villagebehavior.harvest_farm_blockbehavior.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_block