
CRZ:CobblemonFieldMoves
Server-side Fabric mod for Minecraft 1.21.1 + Cobblemon. Use your Pokemon's moves in the overworld while riding them.
Список изменений
Fix 1: Particles going everywhere (beam moves)
Problem: Beam moves like Flamethrower, Ice Beam, Thunderbolt etc. spawned fire/ice/lightning particles all over the place instead of in a straight line.
Root cause: The code was spawning _actor Snowstorm particles (complex animated effects designed to play ON a Pokemon entity) as world particles at multiple positions along the beam (distances 2, 5, 8 blocks). Each one played its full animation independently, creating 6 separate fire/ice sources.
Fix:
- Removed all _actor world particles from beam paths in spawnSpecialMoveEffects()
- The entity particles on the Pokemon (already spawned in execute() at tick 6) handle the visual attack from the Pokemon
- spawnSpecialMoveEffects() now only spawns _target particles at the impact point
- Applied to all 26+ beam moves (Flamethrower, Ice Beam, Thunderbolt, Psychic, Hydro Pump, Shadow Ball, etc.)
- Added getBeamStartPosition() helper that uses the player's look direction for the beam origin offset (not the Pokemon's facing direction)
- Fixed fallback trail guard to skip trails for moves that already have native Cobblemon entity particles
- Reduced special effects cooldown from 1500ms to 800ms since effects are much lighter now
Fix 2: Moves not targeting clicked entities
Problem: When the player was NOT riding the Pokemon (Pokemon sent out nearby), clicking on a mob would fire the move but it would miss the target completely.
Root cause: executeRangedMoveInternal() calculated the beam direction using player.lookAngle starting from the Pokemon's position. Since the Pokemon was far from the player, the ray pointed in a completely different direction than the clicked mob.
Fix:
- Passed the clickedTarget (the entity the player left-clicked) through the entire call chain: CobblemonFieldMod → FieldMoveHandler → MoveExecutor.execute() → executeRangedMoveDelayed() → executeRangedMoveInternal()
- Same for melee: → executeMeleeMoveDelayed() → executeMeleeMoveInternal()
- When clickedTarget exists, lookAngle is now calculated as the direction from the Pokemon to the target instead of using the player's look direction
- For melee moves, the hitbox is centered on the clicked target for reliable hit detection