跳踏(ai-jump)
基本信息
| 属性 | 值 |
|---|---|
| 类名 | toast.specialAI.ai.special.EntityAIJump |
| 实现接口 | ISpecialAI |
| 名称 | jump |
| 默认权重 | 1 |
| 默认存值 | byte 1 |
| 互斥位 | (未设置,默认 0,与所有 AI 不互斥) |
| 优先级 | 0 |
功能
实体周期性地(每 10 tick)跃起(motionY = 0.6)并尝试落在目标头上。持续期间每 tick 重置 fallDistance = 0.0F,避免摔落伤害。
触发条件(shouldExecute)
- 目标存在且存活
nextInt(20) == 0
startExecuting
theEntity.getJumpHelper().setJumping();
theEntity.motionY = 0.6;
continueExecuting
fallDistance > 0(即开始落地)或 nextInt(10) == 0 时维持。
初始化(initialize)
- 靴子位(1)装备带
Enchantment.featherFalling等级 4、Unbreaking等级 3 的皮靴