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

minecraft:behavior.admire_item

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

概览

minecraft:behavior.admire_item 是一个实体组件:写在自定义生物的 components 对象中,或其中某个组件组里。 让生物举起并观赏它喜欢的物品的 AI 目标。需要 minecraft:admire_item 组件才能生效。

字段

字段类型默认值说明
admire_item_soundstring""生物欣赏物品时播放的声音事件。
sound_intervalFloatRange{"max":0,"min":0}两次欣赏音效之间的随机等待秒数范围。
on_admire_item_startActorDefinitionTrigger{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}生物开始欣赏时触发的事件。
on_admire_item_stopActorDefinitionTrigger{"event":"","filters":{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null},"target":"self"}生物停止欣赏时触发的事件。
priorityinteger0数字越小越先执行:两个目标冲突时,priority 更小的那个胜出。范围:0 到 …
control_flagsGoal's control flags[]无此目标接管哪些身体部分(移动、看向、跳跃),占用相同部分的目标不能同时运行。

示例

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

BP/entities/<name>.json
{
  "minecraft:behavior.admire_item": {
    "admire_item_sound": "",
    "sound_interval": {
      "max": 0,
      "min": 0
    },
    "on_admire_item_start": {
      "event": "",
      "filters": {
        "AND": null,
        "NOT": null,
        "OR": null,
        "all": null,
        "all_of": null,
        "any": null,
        "any_of": null,
        "none_of": null
      },
      "target": "self"
    },
    "on_admire_item_stop": {
      "event": "",
      "filters": {
        "AND": null,
        "NOT": null,
        "OR": null,
        "all": null,
        "all_of": null,
        "any": null,
        "any_of": null,
        "none_of": null
      },
      "target": "self"
    },
    "priority": 0,
    "control_flags": []
  }
}

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