🤖 行為配置、目標優先級與狀態存取器
📌 代碼倉庫原始碼免責聲明:本維基文件反映了倉庫當前的原始碼狀態,可能包含領先於 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();
}