|  | 
 
| 创建墨山卫道士 
 创建一个实体,继承卫道士,修改攻击目标
 
 "minecraft:behavior.nearest_attackable_target": {
 "entity_types": [
 {
 "filters": {
 "all_of": [
 {
 "subject": "other",
 "test": "is_family",
 "value": "monster"
 }
 ]
 },
 "within_default": 10
 },
 {
 "filters": {
 "all_of": [
 {
 "subject": "other",
 "test": "is_family",
 "value": "hoglin"
 },
 {
 "operator": "!=",
 "test": "is_difficulty",
 "value": "peaceful"
 }
 ]
 },
 "max_dist": 16
 },
 {
 "filters": {
 "all_of": [
 {
 "subject": "other",
 "test": "is_family",
 "value": "zoglin"
 },
 {
 "operator": "!=",
 "test": "is_difficulty",
 "value": "peaceful"
 }
 ]
 },
 "max_dist": 16
 }
 ],
 "must_reach": true,
 "must_see": true,
 "priority": 3
 },
 其中:
 { "subject": "other", "test": "is_family", "value": "monster" },
 是 monster 家族中的一员(所有敌对怪物,如僵尸、骷髅、蜘蛛等)
 
 修改所属家族:
 
 "minecraft:type_family": {
 "family": [
 "moshan","villager "
 ]
 },
 
 
 修改扮演的角色
 "minecraft:dweller": {
 "can_find_poi": false,
 "can_migrate": true,
 "dweller_role": "defender",
 "dwelling_type": "village",
 "first_founding_reward": 0,
 "update_interval_base": 60,
 "update_interval_variant": 40
 }
 
 该实体在村庄中的角色,常见值:
 - "hostile":敌对(如掠夺者)
 - "defender":守卫(如铁傀儡)
 - "neutral":中立
 - "villager":村民
 ⚠️ hostile 角色会被村庄系统视为敌人。
 
 修改被攻击反击的设置:
 "minecraft:behavior.hurt_by_target": {
 "entity_types": {
 "filters": {
 "operator": "!=",
 "subject": "other",
 "test": "is_family",
 "value": "villager"
 },
 "max_dist": 64
 },
 "priority": 1
 }
 
 这是一个“被攻击后反击”行为:
 作用:如果这个实体被攻击,如果攻击他的不是villager家族就会尝试攻击攻击它的目标。
 
 修改皮肤:
 
   
 看效果:
 
   红外套
 
 
   将村民的敌人视为敌人
 
 
   攻击力超强
 
 
   和铁傀儡并肩作战守护村庄
 | 
 |