Inconsistent mob melee attack rate / mobs double-attacking
The bug
Enemies like Zombies and Endermen are sometimes suddenly attacking quickly 2 times in a row instead of at their normal attack-rate. (Melee attacks only as far as I know). Sometimes the attack animation or sound won't even play.
This can seemingly mess with blocking too, though it could also just be MC-100949
Code analysis
Code analysis by Chumbanotz can be found in this comment.
Linked Issues
is duplicated by3
relates to4
- Unresolved
Mac Rat
- 23
- 11
- Confirmed
Important
- Gameplay
- Mob behaviour
1.16.1 - 24w35a
1.16.1 20w27a 20w28a 20w29a 20w30a 1.16.2-pre1 1.16.2-rc2 1.16.2 1.16.3-rc1 1.16.3 1.16.4-rc1 1.16.4 21w07a 1.17.1 21w37a 1.18.1 22w05a 1.18.2 22w14a 22w15a 1.19-pre3 1.19 1.19.2 1.19.3-pre2 1.19.3 23w06a 23w07a 1.19.4-rc2 1.19.4 1.20-rc1 1.20 1.20.1-rc1 1.20.1 23w33a 1.20.2 1.20.4 24w04a 24w14a 1.20.5-pre1 1.21.1 24w35a
Created Issue:
Inconsistent enemy melee attack-rate / double-attacking
Melee enemies like Zombies and Endermen are sometimes attacking quickly 2 times in a row instead of at their normal attack-rate.
Melee enemies like Zombies and Endermen are sometimes attacking quickly 2 times in a row instead of at their normal attack-rate.
Enemies like Zombies and Endermen are sometimes attacking quickly 2 times in a row instead of at their normal attack-rate. (Melee attacks only as far as I know)
Inconsistentenemymelee attack-rate / double-attackingInconsistent mob melee attack-rate / mobs double-attacking
Enemies like Zombies and Endermen are sometimes suddenly attacking quickly 2 times in a row instead of at their normal attack-rate. (Melee attacks only as far as I know)
Enemies like Zombies and Endermen are sometimes suddenly attacking quickly 2 times in a row instead of at their normal attack-rate. (Melee attacks only as far as I know).
Sometimes the attack animation won't even play.
is duplicated by
Enemies like Zombies and Endermen are sometimes suddenly attacking quickly 2 times in a row instead of at their normal attack-rate. (Melee attacks only as far as I know).
Sometimes the attack animation or sound won't even play.
Enemies like Zombies and Endermen are sometimes suddenly attacking quickly 2 times in a row instead of at their normal attack-rate. (Melee attacks only as far as I know).
Sometimes the attack animation or sound won't even play.
Enemies like Zombies and Endermen are sometimes suddenly attacking quickly 2 times in a row instead of at their normal attack-rate. (Melee attacks only as far as I know). Sometimes the attack animation or sound won't even play.
This can seemingly mess with blocking too, though it could also be just MC-100949
Enemies like Zombies and Endermen are sometimes suddenly attacking quickly 2 times in a row instead of at their normal attack-rate. (Melee attacks only as far as I know). Sometimes the attack animation or sound won't even play.
This can seemingly mess with blocking too, though it could also
bejust MC-100949Enemies like Zombies and Endermen are sometimes suddenly attacking quickly 2 times in a row instead of at their normal attack-rate. (Melee attacks only as far as I know). Sometimes the attack animation or sound won't even play.
This can seemingly mess with blocking too, though it could also just be MC-100949
relates to
I actually got unlucky the last time i got killed because i was full netherite and kill within seconds by a zombie without a weapon because the speed was double the whole time. I also was not doing this in a survival world and was letting the zombie kill me for testing.
is duplicated by
is duplicated by
relates to
Inconsistent mob melee attack-rate / mobs double-attackingInconsistent mob melee attack rate / mobs double-attacking
Enemies like Zombies and Endermen are sometimes suddenly attacking quickly 2 times in a row instead of at their normal attack-rate. (Melee attacks only as far as I know). Sometimes the attack animation or sound won't even play.
This can seemingly mess with blocking too, though it could also just be MC-100949
The bug
Enemies like Zombies and Endermen are sometimes suddenly attacking quickly 2 times in a row instead of at their normal attack-rate. (Melee attacks only as far as I know). Sometimes the attack animation or sound won't even play.
This can seemingly mess with blocking too, though it could also just be MC-100949
Code analysis
Code analysis by Chumbanotz can be found in this comment.
relates to
Thank you for your report!
However, we are already tracking this issue, and this report is a Duplicate of MC-191642, which is a report that has not been resolved yet.
If you want, you can upvote the parent ticket, and enable watching to receive any updates about it - if you believe you have any information that may be important for this issue, please leave a comment on the parent. Please also use the search function in the future to prevent duplicate reports.
Quick Links:
📓 Issue Guidelines – 🛠 Community Support – 📧 Customer Support – ✍️ Feedback and Suggestions – 📖 Game Wiki
💬 Mojira Subreddit – 💬 Mojira Discord
Thank you for your report!
We're tracking this issue in MC-191642, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Mojang Support – ✍️ Feedback and Suggestions – 📖 Game Wiki
The mobs that have this issue all use the MeleeAttackGoal class or their own class that extends it. There is a field called lastCanUseCheck, which is the first check if the goal can be used. This field is used to ensure if at least one second has passed since the last time this goal executed before any other checks are done.
For the goal to execute, the mob then must have a target that is alive and the mob must either have a path to the target, or be within melee range. While the goal is running, a field called followingTargetEvenIfNotSeen is checked to allow the mob to pathfind toward the target even if it cannot be seen. Some mobs have this set to false, and others set to true.
The method MeleeAttackGoal::canContinueToUse is called each tick while the goal is running to check if the goal should continue. The field followingTargetEvenIfNotSeen is checked again in this method and if it's not true, the goal will stop if the mob does not have a path. Which means that when mobs occasionally can't find a path to the target and have followingTargetEvenIfNotSeen set to false, the goal stops and begins the checks to start again as described in the first and second paragraph.
The field lastCanUseCheck should be removed entirely, and the check for followingTargetEvenIfNotSeen in the method MeleeAttackGoal::canContinueToUse should also be removed.
This issue is directly responsible for MC-191642. The field that controls the attack timer is called ticksUntilNextAttack. When the goal starts, this field is set to zero, which, as a result of the above description, causes the timer to reset and allow the mob to attack twice in a row. The method MeleeAttackGoal::start should remove where the field ticksUntilNextAttack is set to zero.
Seems like a duplicate of MC-191642.
Might be related to MC-191642.
This seems to be the same general behavior described in MC-131426 MC-191642 MC-169167, at least with the slimes. They can attack the player when they're near to them, rather than having a 'normal' attack like other mobs. I tried to reproduce this with a husk mob, and could not get the same result as the slime. Can you reproduce this with all/most hostile mobs?
This is intentionally different to 1.15.2 due to the fixing of
MC-147516, so yes, they are more likely to attack more often now. Please provide a short clip of what you think is the issue here with your F3 debug screen enabled.I was going to mention the bug fix of
MC-147516at first because I do think it's a side effect caused by the fix, but then decided not to.They can now attack normally without stopping due to that fix, as intended... But they can now also sometimes suddenly attack 2 times in a row out of nowhere. This unexpected inconsistency can mess with the player's blocking and expected health during the fight.
I'll try to provide a clip when I can during the 24 hours.
I made a quick video of the bug in 1.17pre2 and uploaded it here.
The zombie would usually hit me every 20 ticks or so if I was standing still, but I would get more frequent double-attacks if I pulled away right as it hit me and then immediately strafed back into it. Sometimes the time between attacks was in the single digits although this was fairly rare.
Can confirm in 1.17.1.
Yep, an issue I too am experiencing in 1.17.1 - double strikes seem to be happening a lot lately, which is especially frustrating when you are playing hardcore.
Can confirm in 1.18.1 and 22w05a.
Can confirm in 1.18.2.
In 22w14a
1.19 as well.
I love y'all Mojang, but that this is still an issue almost 2 years later is kinda really frustrating at times.
(Doesn't change how awesome y'all are ofc, don't get me wrong
)
Can confirm in 1.19.2.
Also present in 1.19.3 pre-2 it seems.
OK, I STILL stand by my previous comment that I love y'all, Mojang, but seriously, this still being a thing is getting ridiculous.
In 23w33a
Confirmed in 1.20.2
STILL a problem in 24w14A.
Seriously, WHY is this still a thing FOUR YEARS LATER? 🤬
Relates to MC-131426