🤖 行为配置、目标优先级与状态访问器
📌 代码仓库源码免责声明:本维基文档反映了仓库当前的源代码状态,可能包含领先于 CurseForge 与 Modrinth 上公开发布版本的最新开发提交或未发布功能。
📊 AI 目标优先级矩阵
All custom goals set move flags (this.setFlags(EnumSet.of(Goal.Flag.MOVE))) to prevent conflicting movement vector calculations:
| Priority Level | Goal Class | Activation Condition | Behavior Summary |
|---|---|---|---|
| Priority 1 | BatPanicGoal | Acoustic vibration detected (distSq < 256.0) | Instant flock dispersion, rapid fleeing away from disturbance |
| Priority 2 | BatSleepGoal | Daytime (world.isDay()) or darkness retreat | Seeks dark ceilings, stalactites, lanterns; hangs inverted |
| Priority 3 | BatHuntLightGoal | Nighttime & artificial light within 10 blocks | Approaches lantern/torch, transitions into circular banking orbit |
| Priority 4 | BatDiveBombGoal | Silverfish / Endermite within 8 blocks | Ascends, locks target, delivers high-speed dive-bomb impact |
| Priority 5 | BatFlightHelper / Flocking | Airborne, no high-priority interrupts | Continuous 3D BOIDs cohesion, alignment, separation flight |
☕ 独立开发者寄语:如果你喜欢蝙蝠逼真的三维群飞和鸟粪为庄稼施肥的生态体验,欢迎在 Ko-fi 上支持我的独立开发!
🔌 状态访问器接口协议
BatStateAccessor allows external mods or internal mixins to inspect live bat state without reflection:
java
public interface BatStateAccessor {
boolean betterbats$isPanicking();
boolean betterbats$isHuntingLight();
BlockPos betterbats$getTargetLightPos();
}