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

minecraft:behavior.play

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

概览

minecraft:behavior.play 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物(通常是村民小孩)找个伙伴玩追逐游戏,在附近随机地点跑来跑去。

字段

字段类型默认值说明
speed_multipliernumber1这个目标运行时让生物加速或减速:1 为正常速度。范围:0 到 …
max_play_duration_secondsnumber50生物玩耍的最长时间(秒),之后会停下。范围:0 到 …
chance_to_startnumber0.0025生物开始玩耍的几率,从 0 到 1。范围:0 到 1
friend_typesEntityTypes无哪些实体可以成为玩伴。
friend_search_areavec3[6,3,6]以生物为中心、用来寻找玩伴的范围盒大小。
random_pos_search_rangeinteger16生物在水平方向上寻找随机奔跑地点的范围。范围:1 到 …
random_pos_search_heightinteger3生物在上下方向上寻找随机奔跑地点的范围。范围:1 到 …
follow_distanceinteger2生物跟随伙伴时尽量保持的距离。范围:0 到 …
priorityinteger0多个目标同时想运行时决定谁优先:数字越小越先运行。范围:0 到 …
control_flagsGoal's control flags[]无列出这个目标要控制的身体部分(比如移动、看向或跳跃),这样需要同一部分的目标就不会同时运行。

示例

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

BP/entities/<name>.json
{
  "minecraft:behavior.play": {
    "speed_multiplier": 1,
    "max_play_duration_seconds": 50,
    "chance_to_start": 0.0025,
    "friend_types": {},
    "friend_search_area": [
      6,
      3,
      6
    ],
    "random_pos_search_range": 16,
    "random_pos_search_height": 3,
    "follow_distance": 2
  }
}

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