萨满(ai-shaman)
基本信息
| 属性 |
值 |
| 类名 |
toast.specialAI.ai.special.EntityAIShaman |
| 实现接口 |
ISpecialAI |
| 名称 |
shaman |
| 默认权重 |
1 |
| 默认存值 |
float 1.0(每次治疗量)+ 子标签 shamanFX(自定义药水效果) |
| 互斥位 |
MOVEMENT + FACING |
| 优先级 |
0 |
功能
当自身有攻击目标时,搜寻 16×8×16 范围内同样以该目标为敌的同盟生物 followTarget(随机洗牌后第一个),随后尝试靠近(≤ 6 格 follow)并每 20 tick 给其 +1 HP 治疗 + 灭火 + 应用增益效果(默认 31 tick 的 Strength I、Resistance II、Speed II),同时播放 2005 音效(zombie villager cure)。
触发条件(shouldExecute)/ continueExecuting
findFollowTarget() 找到同盟(也以当前 attackTarget 为敌的生物)
- 后续每 tick
continueExecuting:
- 目标存在且同盟存在
- 同盟仍以同一目标为敌,或重新找到新同盟
治疗与效果
| 默认 |
自定义(shamanFX 存在时) |
+healAmount (1.0) |
同上 |
addPotionEffect(Potion.damageBoost, 31, 0) |
读 shamanFX 中的 NBTTagCompound 列表,逐个 PotionEffect.readCustomPotionEffectFromNBT 并添加 |
addPotionEffect(Potion.resistance, 31, 1) |
同上 |
addPotionEffect(Potion.moveSpeed, 31, 1) |
同上 |
extinguish() |
同上 |
playAuxSFX(2005, ...) |
同上 |
路径选择
distance² > 36:tryMoveToEntityLiving(followTarget, 1.3)
distance² < 4:clearPathEntity()
- 否则按当前路径行走
初始化(initialize)
- 主手位(0):骨头
- 头盔位(4):
Blocks.lit_pumpkin
maxHealth +20,立即 setHealth(+20)
相关条目