minecraft:behavior.transport_items

A behavior that enables a mob to transport items from and to containers.

Properties

PropertyTypeDefaultWhat it does
source_container_typesList of object or text[]A list of block descriptors that should be a container type to get items from.
destination_container_typesList of object or text[]A list of block descriptors that should be a container type to put items in.
max_stack_sizeInteger1 to 6464The maximum stack size that the mob will try to take from a container.
interaction_timeDecimalmin 03The amount of time in seconds spent interacting with the containers.
allow_simultaneous_interactionBooleanfalseWhen true the mob will wait until a container is not used by other entities before starting to interact with it.
search_strategyTextnearest, random"random"The strategy to use for finding source or destination containers. The nearest valid container or a random valid container in range.
search_distanceList of decimal or Object[64, 32]The maximum search distance horizontally and vertically at which to find containers for taking or placing items.
xDecimal0
yDecimal0
max_visited_containersIntegermin 016The maximum number of containers that the mob will try to take/place items from before going on cooldown and starting over.
initial_cooldownIntegermin 00How long the mob will wait after spawning or getting the goal added before the goal can start.
idle_cooldownIntegermin 020When 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_strategyTextany, 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_itemsList 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_itemsList 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.
priorityIntegermin 00
control_flagsList 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