Skip to content

🏮 趋光性与夜间灯火环绕巡飞 ​

📌 代码仓库源码免责声明:本维基文档反映了仓库当前的源代码状态,可能包含领先于 CurseForge 与 Modrinth 上公开发布版本的最新开发提交或未发布功能。

ParameterSpecification Details
AI Goal Classnet.vanillaoutsider.betterbats.ai.BatHuntLightGoal
Detection Light LevelBlock Light > 8 (LIGHT_DETECT_THRESHOLD)
Continue Light LevelBlock Light > 6 (LIGHT_CONTINUE_THRESHOLD)
Search Radius10 blocks (Deterministic BlockPos.findClosestMatch)
Search ThrottleExecutes light search once every 30 ticks (~1.5s)
Orbit Duration200 to 600 ticks ($10 - 30\text{ seconds}$)
Goal Cooldown200 to 400 ticks ($10 - 20\text{ seconds}$)
Approach ModeCurved banking flight vector ($d > 2.5\text{ blocks}$)
Orbiting ModeTangential velocity vector with sine-wave vertical bobbing
Visual ParticlesCRIT (10% tick probability during orbit)

☕ 独立开发者寄语:如果你喜欢蝙蝠逼真的三维群飞和鸟粪为庄稼施肥的生态体验,欢迎在 Ko-fi 上支持我的独立开发!


🌙 飞蛾效应 (The Moth Effect) ​

At night, bats are attracted to artificial light sources (torches, lanterns, campfires, sea lanterns). When within 10 blocks of a valid light block with Block Light > 8, BatHuntLightGoal activates. Bats approach the light and transition into smooth circular orbits.


📐 切向旋回向量数学 ​

The orbital velocity vector is calculated perpendicularly to the radial position vector $\vec{r} = \vec{P}{\text{bat}} - \vec{P}{\text{light}}$:

$$\vec{V}{\text{tangent}} = \frac{(-r_z, 0, r_x)}{|\vec{r}|} \times v{\text{orbit}}$$

A sine-wave vertical modulation adds organic natural bobbing:

$$V_y = A \sin(\omega t)$$


Next: 三维群飞与转向数学 | 害虫防治与俯冲战斗

Official documentation & web portal for Dasik Igaijinn mods.