The bug
When a spider/wolf leaps at you, it deals no damage as it's in the air, but when it lands it deals damage. I've also noticed as they're leaping their heads point completely straight, as opposed to them still looking at you, similar to how creepers stare straight as they explode. Doesn't affect mobs under version 14w06a when it got the new AI.
This actively affects both mobs ability to land hits in combat.
Note: This bug does not differ with the mob attack changes with 23w33a
How to reproduce
Spawn spider/wolf
Walk up to it, aggro it, and wait until it pounces
Notice its head point straight forward while it pounces and it deals no damage while it's in midair
In the pictures, the mobs are touching me as they're leaping, but deal no damage until they hit the ground. Of course I took some damage waiting for them to leap, but as they jumped no damage was dealt.
--------------------------------------
Potential Fix from Chumbanotz:
"Spiders and Wolves use the class LeapAtTargetGoal
which handles the leaping at their target. This class calls Goal::setFlags
in its constructor with the values of Goal.Flag.MOVE
and Goal.Flag.LOOK
. These flags prevent other AI goals with the same flags from executing. The MeleeAttackGoal
handles the melee attack and has the same goal flags set. To fix this, remove the call to Goal::setFlags
from the LeapAtTargetGoal
to allow it to run at the same time as MeleeAttackGoal
."
Related issues
Attachments
Comments


According to the wiki:
"Wolves attack their targets by leaping at them in exactly the same manner as spiders, but cause no damage while in midair."
However, after testing what you said, I agree that what you said has happened to me too.
so basically I can confirm this.

Confirmed in 1.16.2
I don't think the bug is as straight forward as the description says though, maybe it's been partially fixed
But in third person you can see that the damaging is not instant when they are in mid air, and they only look straight forward when jumping
edit: I think I only tested this with wolves btw
Can confirm in 20w48a.
Can confirm in 20w51a.
Can confirm in 21w05b.
Can confirm in 21w06a.

Spiders and Wolves use the class LeapAtTargetGoal
which handles the leaping at their target. This class calls Goal::setFlags
in its constructor with the values of Goal.Flag.MOVE
and Goal.Flag.LOOK
. These flags prevent other AI goals with the same flags from executing. The MeleeAttackGoal
handles the melee attack and has the same goal flags set. To fix this, remove the call to Goal::setFlags
from the LeapAtTargetGoal
to allow it to run at the same time as MeleeAttackGoal
.
Can confirm in 1.19.2.

Affects 1.20

You can collide them while they are mid air and take no damage, why wouldn't that be a bug. It often seems like when you take damage its delayed and doesnt match with their leap animation properly.

In full 1.21.5 release