minecraft:behavior.pickup_items

Allows the mob to pick up items on the ground.

Properties

PropertyTypeDefaultWhat it does
stop_if_holding_itemBooleanfalseIf true, the mob will not pick up another item if the item's preferred slot matches
speed_multiplierDecimal1Movement speed multiplier of the mob when using this AI Goal
track_targetBooleanfalseIf true, this mob will chase after the target as long as it's a valid target
max_distInteger1Maximum distance this mob will look for items to pick up
search_heightInteger1Height in blocks the mob will search for items
goal_radiusDecimal0.5Distance 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_chanceBooleanfalseIf true, depending on the difficulty, there is a random chance that the mob may not be able to pickup items
can_pickup_any_itemBooleanfalseIf true, the mob can pick up any item
cooldown_after_being_attackedInteger0Time in seconds the mob cannot pickup items after being attacked
can_pickup_to_hand_or_equipmentBooleantrueIf true, the mob can pick up items to its hand or armor slots
pickup_same_items_as_in_handBooleanfalseIf true, the mob will only pick up items that match what's in their hand
on_pickup_item_startObject{"event": "", "filters": {"AND": null, "NOT": null, "OR":…Event to run when this mob moves to pick up an item
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.
on_pickup_item_endObject{"event": "", "filters": {"AND": null, "NOT": null, "OR":…Event to run when this mob either finishes or loses interest in picking up an item
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.
excluded_itemsList of text or object[]List of items this mob will not pick up
priorityIntegermin 00
control_flagsList 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