Creepers can unexpectedly target and explode near spear-wielding zombies when the zombie accidentally hits the creeper with a spear while attacking a player.
This appears to be related to the difference between the zombie’s and creeper’s player detection ranges.
A creeper can retaliate against another mob when it takes damage from that mob. However, creepers normally prioritize attacking a nearby player. If the player is outside the creeper’s detection range, the creeper can instead target the mob that damaged it.
Spear-wielding zombies can detect and attack players from considerably farther away than creepers can detect players. Because spear attacks can hit entities along the attack path, a zombie attacking a distant player can accidentally hit a creeper standing between the zombie and the player.
If the player is outside the creeper’s detection range but still within the zombie’s detection range, the following can happen:
Zombie detects player → Zombie attacks player with spear → Spear hits creeper → Creeper retaliates against zombie → Creeper starts its explosion countdown and explodes.
This behavior does not appear to occur in the same situation with skeleton arrows, presumably because the skeleton and creeper have similar player detection ranges, meaning that a creeper hit by an arrow while the skeleton is targeting a player will normally also be able to detect that player.
Steps to reproduce
Create or find a creeper and a spear-wielding zombie.
Place the creeper between the zombie and the player.
Keep the player far enough away from the creeper that the creeper cannot detect the player, while remaining within the zombie’s detection range.
Allow the zombie to detect the player and attack with its spear.
Have the spear hit the creeper.
Observe the creeper’s behavior.
The creeper can turn toward the zombie that hit it, begin its explosion countdown, and explode even though the zombie was not originally its target.
Actual behavior
The creeper retaliates against the spear-wielding zombie and explodes.
This can happen even though the zombie was originally trying to attack the player rather than the creeper.
Expected behavior
The creeper should not unexpectedly explode because it was accidentally hit by a spear-wielding zombie while the zombie was attacking a player.
At minimum, the interaction between spear attacks, creeper retaliation, and target selection should behave consistently with other ranged attacks such as skeleton arrows.
Additional observations
This behavior appears to be particularly easy to reproduce with zombies because zombies can detect players from farther away than creepers.
Skeletons attacking players with arrows generally do not produce the same behavior.
Snow golems attacking creepers are a separate known/previously reported behavior and are not the main subject of this report.
The issue appears to become possible because spear attacks can hit entities other than the zombie’s intended target.
The problem can be particularly undesirable in mob farms, where a spear-wielding zombie can cause creepers to explode unexpectedly.
Linked issues
relates to 3
Attachments
Comments 2
Thank you for your report!
After consideration, the issue is being closed as Working as Intended.
Please note, that mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.
Full Version History – Snapshot Version History – The official Minecraft feedback site
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
Can confirm, highly related to MC-74908.