minecraft:behavior.pickup_items
Allows the mob to pick up items on the ground.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
stop_if_holding_item | Boolean | false | If true, the mob will not pick up another item if the item's preferred slot matches |
speed_multiplier | Decimal | 1 | Movement speed multiplier of the mob when using this AI Goal |
track_target | Boolean | false | If true, this mob will chase after the target as long as it's a valid target |
max_dist | Integer | 1 | Maximum distance this mob will look for items to pick up |
search_height | Integer | 1 | Height in blocks the mob will search for items |
goal_radius | Decimal | 0.5 | Distance in blocks within the mob considers it has reached the goal. This is the "wiggle room" to stop the AI from bouncing back and forth trying to reach a specific spot |
pickup_based_on_chance | Boolean | false | If true, depending on the difficulty, there is a random chance that the mob may not be able to pickup items |
can_pickup_any_item | Boolean | false | If true, the mob can pick up any item |
cooldown_after_being_attacked | Integer | 0 | Time in seconds the mob cannot pickup items after being attacked |
can_pickup_to_hand_or_equipment | Boolean | true | If true, the mob can pick up items to its hand or armor slots |
pickup_same_items_as_in_hand | Boolean | false | If true, the mob will only pick up items that match what's in their hand |
on_pickup_item_start | Object | {"event": "", "filters": {"AND": null, "NOT": null, "OR":… | Event to run when this mob moves to pick up an item |
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. |
on_pickup_item_end | Object | {"event": "", "filters": {"AND": null, "NOT": null, "OR":… | Event to run when this mob either finishes or loses interest in picking up an item |
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. |
excluded_items | List of text or object | [] | List of items this mob will not pick up |
priority | Integermin 0 | 0 | |
control_flags | List of text | [] |
Example from the game files
This is how vanilla Allay uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:behavior.pickup_items": {
"can_pickup_any_item": false,
"search_height": 32,
"priority": 2,
"goal_radius": 2.2,
"can_pickup_to_hand_or_equipment": false,
"max_dist": 32,
"pickup_based_on_chance": false,
"pickup_same_items_as_in_hand": true,
"speed_multiplier": 6
}
}Used by 20
Vanilla entities with minecraft:behavior.pickup_items in their definition:
Related components
behavior.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_blockbehavior.transport_items