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

minecraft:behavior.transport_items

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

Overview

minecraft:behavior.transport_items is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Makes the mob carry items from one kind of container to another, like the copper golem moving items out of copper chests into other chests.

Fields

FieldTypeDefaultDescription
source_container_typesBlock Descriptor[]noneWhich container blocks the mob takes items from.
destination_container_typesBlock Descriptor[]noneWhich container blocks the mob puts items into.
max_stack_sizeinteger64Most items the mob takes from a container at once.Range: 1 to 64
interaction_timenumber3Seconds the mob spends at a container each visit.Range: 0 to …
allow_simultaneous_interactionbooleanfalseControls whether the mob waits for a container to be free when another entity is using it.
search_strategyenum"random"How the mob picks a container: the nearest one or a random one in range.One of: nearest, random
search_distanceVec2[64,32]How far sideways and up or down the mob looks for containers.
max_visited_containersinteger16How many containers the mob tries before it takes a break and starts over.Range: 0 to …
initial_cooldowninteger0How long the mob waits after spawning, or after getting this goal, before it starts.Range: 0 to …
idle_cooldowninteger20Seconds the goal pauses when no suitable container can be found.Range: 0 to …
place_strategyenum"any"When to drop items into a container: always if there is room, only if it already holds the same item, or if it holds the same item or is empty.One of: any, with_matching, with_matching_or_empty
allowed_itemsItem Descriptor[]noneThe only items the mob may carry. Leave this and disallowed_items empty to allow everything.
disallowed_itemsItem Descriptor[]noneItems the mob may not carry. Use either this or allowed_items, not both.
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.transport_items": {
    "source_container_types": [],
    "destination_container_types": [],
    "max_stack_size": 64,
    "interaction_time": 3,
    "allow_simultaneous_interaction": false,
    "search_strategy": "random",
    "search_distance": [
      64,
      32
    ],
    "max_visited_containers": 16
  }
}

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