minecraft:behavior.transport_items
A behavior that enables a mob to transport items from and to containers.
Properties
| Property | Type | Default | What it does |
|---|---|---|---|
source_container_types | List of object or text | [] | A list of block descriptors that should be a container type to get items from. |
destination_container_types | List of object or text | [] | A list of block descriptors that should be a container type to put items in. |
max_stack_size | Integer1 to 64 | 64 | The maximum stack size that the mob will try to take from a container. |
interaction_time | Decimalmin 0 | 3 | The amount of time in seconds spent interacting with the containers. |
allow_simultaneous_interaction | Boolean | false | When true the mob will wait until a container is not used by other entities before starting to interact with it. |
search_strategy | Textnearest, random | "random" | The strategy to use for finding source or destination containers. The nearest valid container or a random valid container in range. |
search_distance | List of decimal or Object | [64, 32] | The maximum search distance horizontally and vertically at which to find containers for taking or placing items. |
x | Decimal | 0 | |
y | Decimal | 0 | |
max_visited_containers | Integermin 0 | 16 | The maximum number of containers that the mob will try to take/place items from before going on cooldown and starting over. |
initial_cooldown | Integermin 0 | 0 | How long the mob will wait after spawning or getting the goal added before the goal can start. |
idle_cooldown | Integermin 0 | 20 | When the mob cannot find a container in which to get or put items, the goal will stop being active for this amount of time in seconds. |
place_strategy | Textany, with_matching, with_matching_or_empty | "any" | The strategy to use for placing the transported item. Any - always place if there is room, With matching - place if there is a matching item in the container, With matching or empty - like With matching but will also place in empty containers |
allowed_items | List of text or object | [] | A list of item descriptors that are the only items the mob is allowed to transport. If this and "disallowed_items" are both empty, then all items are allowed. If non-empty "disallowed_items" must be empty. |
disallowed_items | List of text or object | [] | A list of item descriptors that are the mob is not allowed to transport. If non-empty "allowed_items" must be empty. |
priority | Integermin 0 | 0 | |
control_flags | List of text | [] |
Example from the game files
This is how vanilla Copper Golem uses it in Minecraft Bedrock 1.26.60.5:
{
"minecraft:behavior.transport_items": {
"source_container_types": [
{
"name": "minecraft:copper_chest"
},
{
"name": "minecraft:exposed_copper_chest"
},
{
"name": "minecraft:oxidized_copper_chest"
},
{
"name": "minecraft:waxed_copper_chest"
},
{
"name": "minecraft:waxed_exposed_copper_chest"
},
{
"name": "minecraft:waxed_oxidized_copper_chest"
},
{
"name": "minecraft:waxed_weathered_copper_chest"
},
{
"name": "minecraft:weathered_copper_chest"
}
],
"destination_container_types": [
{
"name": "minecraft:chest"
},
{
"name": "minecraft:trapped_chest"
}
],
"max_stack_size": 16,
"search_strategy": "nearest",
"search_distance": [
32,
8
],
"max_visited_containers": 10,
"initial_cooldown": 3,
"idle_cooldown": 7,
"place_strategy": "with_matching_or_empty",
"priority": 3
}
}Used by 1
Vanilla entities with minecraft:behavior.transport_items 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