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

minecraft:behavior.play_dead

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

概览

minecraft:behavior.play_dead 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物受伤后翻倒装死,让攻击者失去兴趣。美西螈会用它,并在装死时恢复生命。

字段

字段类型默认值说明
durationnumber1生物装死持续的时间(秒)。
random_start_chancenumber1受到伤害时开始装死的几率。
force_below_healthinteger0生物生命值低于这个值时,任何伤害都会让它装死。
random_damage_rangeIntRange{"max":0,"min":0}低于最小值的伤害永远不会触发,高于最大值的伤害一定会触发,介于两者之间则随机。
damage_sourcesActorDamageCause[]无哪些伤害类型可以让生物装死。
apply_regenerationbooleanfalse设为 true 时,生物装死期间获得生命恢复效果。
filtersFilter Group{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}生物装死必须额外满足的条件。
priorityinteger0多个目标同时想运行时决定谁优先:数字越小越先运行。范围:0 到 …
control_flagsGoal's control flags[]无列出这个目标要控制的身体部分(比如移动、看向或跳跃),这样需要同一部分的目标就不会同时运行。

示例

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

BP/entities/<name>.json
{
  "minecraft:behavior.play_dead": {
    "duration": 1,
    "random_start_chance": 1,
    "force_below_health": 0,
    "random_damage_range": {
      "max": 0,
      "min": 0
    },
    "damage_sources": [],
    "apply_regeneration": false,
    "filters": {
      "AND": null,
      "NOT": null,
      "OR": null,
      "all": null,
      "all_of": null,
      "any": null,
      "any_of": null,
      "none_of": null
    },
    "priority": 0
  }
}

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