网易我的世界论坛

标题: 怎么让自定义生物主动攻击玩家或者原有生物 [打印本页]

作者: HiM小特    时间: 2020-11-21 21:17
标题: 怎么让自定义生物主动攻击玩家或者原有生物
怎么让自定义生物主动攻击玩家或者原有生物
作者: 境界线    时间: 2020-11-23 10:05
  1. "minecraft:behavior.nearest_attackable_target": {
  2.           "priority": 4,
  3.           "entity_types": [
  4.             {
  5.               "filters": {
  6.                 "any_of": [
  7.                   { "test" :  "is_family", "subject" : "other", "value" :  "player"}, //玩家
  8.                   { "test" :  "is_family", "subject" : "other", "value" :  "sheep"}, //羊
  9.                   { "test" :  "is_family", "subject" : "other", "value" :  "mob"}//原版生物
  10.                 ]
  11.               },
  12.               "max_dist": 16
  13.             }
  14.           ],
  15.           "must_see": true
  16.         }
复制代码

作者: Mrkwtkr    时间: 2020-11-23 10:32
本帖最后由 Mrkwtkr 于 2020-11-23 10:35 编辑

可以用实体组件里的behavior.nearest_attackable_target,设置生物要搜寻的攻击目标,参考wiki"基岩版实体组件文档"




欢迎光临 网易我的世界论坛 (http://mc.netease.com/) Powered by Discuz! X3.3