🏮 Fototaxia y vuelo orbital nocturno alrededor de luces
📌 Aviso sobre el código fuente del repositorio: La documentación de esta Wiki refleja el estado actual del código fuente en el repositorio, que puede incluir confirmaciones recientes o características en desarrollo no disponibles aún en CurseForge o Modrinth.
| Parameter | Specification Details |
|---|---|
| AI Goal Class | net.vanillaoutsider.betterbats.ai.BatHuntLightGoal |
| Detection Light Level | Block Light > 8 (LIGHT_DETECT_THRESHOLD) |
| Continue Light Level | Block Light > 6 (LIGHT_CONTINUE_THRESHOLD) |
| Search Radius | 10 blocks (Deterministic BlockPos.findClosestMatch) |
| Search Throttle | Executes light search once every 30 ticks (~1.5s) |
| Orbit Duration | 200 to 600 ticks ($10 - 30\text{ seconds}$) |
| Goal Cooldown | 200 to 400 ticks ($10 - 20\text{ seconds}$) |
| Approach Mode | Curved banking flight vector ($d > 2.5\text{ blocks}$) |
| Orbiting Mode | Tangential velocity vector with sine-wave vertical bobbing |
| Visual Particles | CRIT (10% tick probability during orbit) |
☕ Nota del desarrollador: Si disfrutas de los murciélagos en bandadas 3D realistas y fertilizando cultivos con guano, ¡apoya mi trabajo en Ko-fi!
🌙 El efecto polilla (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.
📐 Matemáticas del vector tangencial
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: Bandadas 3D BOIDs y física | Control de plagas y ataque
