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

minecraft:behavior.pickup_items

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

Overview

minecraft:behavior.pickup_items is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Lets the mob walk to items lying on the ground and pick them up. Zombies, foxes and piglins use it.

Fields

FieldTypeDefaultDescription
stop_if_holding_itembooleanfalseIf true, the mob won't pick up an item if it already holds something in that item's slot.
speed_multipliernumber1Speeds the mob up or slows it down while this goal runs: 1 is normal speed.
track_targetbooleanfalseIf true, the mob keeps chasing the item as long as it is still valid.
max_distinteger1How far away the mob looks for items.
search_heightinteger1How far up and down the mob looks for items.
goal_radiusnumber0.5How close the mob must get before it counts as arrived. A little room stops it from jittering around one spot.
pickup_based_on_chancebooleanfalseIf true, there is a random chance (based on difficulty) that the mob can't pick items up.
can_pickup_any_itembooleanfalseIf true, the mob can pick up any item, not just ones it can use.
cooldown_after_being_attackedinteger0Seconds the mob won't pick up items after being hit.
can_pickup_to_hand_or_equipmentbooleantrueIf true, items can go into the mob's hand or armor slots.
pickup_same_items_as_in_handbooleanfalseIf true, the mob only picks up items that match what it already holds.
on_pickup_item_startActorDefinitionTrigger{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Event that runs when the mob starts moving to an item.
on_pickup_item_endActorDefinitionTrigger{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}Event that runs when the mob picks up the item or gives up on it.
excluded_itemsItem Descriptor[]noneItems this mob will never pick up.
priorityinteger0Decides which goal wins when several want to run: lower numbers run first.Range: 0 to …
control_flagsGoal's control flags[]noneLists the body parts this goal takes control of (such as move, look or jump), so goals that need the same part don't run together.

Example

Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):

BP/entities/<name>.json
{
  "minecraft:behavior.pickup_items": {
    "stop_if_holding_item": false,
    "speed_multiplier": 1,
    "track_target": false,
    "max_dist": 1,
    "search_height": 1,
    "goal_radius": 0.5,
    "pickup_based_on_chance": false,
    "can_pickup_any_item": false
  }
}

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