1. Wiki
  2. /实体
  3. /minecraft:behavior.transport_items

minecraft:behavior.transport_items

不想手写?在 GodCraft 里打开一个开关,就能帮你设置好 minecraft:behavior.transport_items。Get GodCraft

概览

minecraft:behavior.transport_items 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物把物品从一种容器搬到另一种容器,就像铜傀儡把物品从铜箱子搬进其他箱子。

字段

字段类型默认值说明
source_container_typesBlock Descriptor[]无生物从哪些容器方块中拿取物品。
destination_container_typesBlock Descriptor[]无生物把物品放进哪些容器方块。
max_stack_sizeinteger64生物一次从容器中拿取的最大物品数量。范围:1 到 64
interaction_timenumber3生物每次在容器旁停留的秒数。范围:0 到 …
allow_simultaneous_interactionbooleanfalse控制容器被其他实体使用时,生物是否等待容器空出来。
search_strategyenum"random"生物如何选择容器:最近的,还是范围内随机的一个。可选值:nearest, random
search_distanceVec2[64,32]生物在水平和上下方向上寻找容器的范围。
max_visited_containersinteger16生物尝试多少个容器后休息一下并重新开始。范围:0 到 …
initial_cooldowninteger0生物生成或获得这个目标后,开始运行前等待多久。范围:0 到 …
idle_cooldowninteger20找不到合适容器时目标暂停的秒数。范围:0 到 …
place_strategyenum"any"何时把物品放进容器:只要有空间就放、只在已有相同物品时放,或在有相同物品或为空时放。可选值:any, with_matching, with_matching_or_empty
allowed_itemsItem Descriptor[]无生物唯一可以搬运的物品。这个和 disallowed_items 都留空则允许所有物品。
disallowed_itemsItem Descriptor[]无生物不能搬运的物品。只能使用这个或 allowed_items 其中之一,不能同时使用。
priorityinteger0多个目标同时想运行时决定谁优先:数字越小越先运行。范围:0 到 …
control_flagsGoal's control flags[]无列出这个目标要控制的身体部分(比如移动、看向或跳跃),这样需要同一部分的目标就不会同时运行。

示例

写在 BP/entities/<name>.json 的 components 对象中(值为默认值或占位值):

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