-
Bug
-
Resolution: Fixed
-
Minecraft 1.4.3, Snapshot 13w05b, Minecraft 1.5.1, Minecraft 1.5.2, Minecraft 1.6.1, Minecraft 1.6.2, Minecraft 1.7.2, Minecraft 1.7.5, Minecraft 14w11b, Minecraft 1.7.6-pre1, Minecraft 1.7.6-pre2, Minecraft 14w18b, Minecraft 1.8-pre1, Minecraft 1.8-pre2, Minecraft 1.8, Minecraft 1.8.1, Minecraft 1.8.3, Minecraft 1.8.8, Minecraft 15w33b, Minecraft 15w33c, Minecraft 15w47c, Minecraft 15w49a, Minecraft 1.8.9, Minecraft 15w50a, Minecraft 16w02a, Minecraft 16w05b, Minecraft 16w06a, Minecraft 1.9 Pre-Release 2, Minecraft 1.9 Pre-Release 3, Minecraft 1.9 Pre-Release 4, Minecraft 1.9, Minecraft 1.9.1 Pre-Release 1, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.9.2, Minecraft 1.9.4, Minecraft 1.10, Minecraft 1.10.2, Minecraft 16w32a, Minecraft 16w32b, Minecraft 16w33a, Minecraft 16w35a, Minecraft 16w40a, Minecraft 16w41a, Minecraft 16w44a, Minecraft 1.11 Pre-Release 1, Minecraft 1.11.2, Minecraft 17w06a, Minecraft 1.12 Pre-Release 2, Minecraft 1.12 Pre-Release 6, Minecraft 1.12, Minecraft 1.12.1, Minecraft 1.12.2, Minecraft 18w03b, Minecraft 18w07c, Minecraft 18w21b, Minecraft 1.13-pre3, Minecraft 1.13, Minecraft 1.13.1, Minecraft 1.13.2, Minecraft 18w43c, Minecraft 18w47b, Minecraft 18w50a, Minecraft 19w04b, Minecraft 19w05a, Minecraft 19w11b, Minecraft 19w12b, Minecraft 19w13a, Minecraft 19w14a, Minecraft 1.14 Pre-Release 1, Minecraft 1.14 Pre-Release 2, Minecraft 1.14 Pre-Release 4, Minecraft 1.14 Pre-Release 5, Minecraft 1.14, Minecraft 1.14.1, Minecraft 1.14.2 Pre-Release 1, Minecraft 1.14.2 Pre-Release 2, Minecraft 1.14.2, Minecraft 1.14.3, Minecraft 1.14.4 Pre-Release 1, Minecraft 1.14.4 Pre-Release 3, Minecraft 1.14.4 Pre-Release 4, Minecraft 1.14.4 Pre-Release 5, Minecraft 1.14.4 Pre-Release 6, 1.14.4, 19w34a, 19w35a, 19w36a, 19w37a, 19w38b, 19w39a, 19w40a, 19w41a, 19w42a, 19w45b, 19w46b, 1.15 Pre-release 1, 1.15 Pre-Release 2, 1.15 Pre-release 3, 1.15 Pre-release 4, 1.15 Pre-release 5, 1.15 Pre-release 6, 1.15 Pre-release 7, 1.15, 1.15.1, 1.15.1 Pre-release 1, 1.15.2 Pre-Release 1, 1.15.2 Pre-release 2, 1.15.2, 20w06a, 20w07a, 20w08a, 20w09a, 20w10a, 20w11a, 20w13a, 20w13b, 20w15a, 20w17a, 20w18a, 20w19a, 20w20a, 20w20b, 20w21a, 1.16 Pre-release 2, 1.16 Pre-release 3, 1.16 Pre-release 6, 1.16 Pre-release 7, 1.16 Pre-release 8, 1.16 Release Candidate 1, 1.16, 1.16.1, 20w28a, 20w29a, 20w30a, 1.16.2 Pre-release 1, 1.16.2 Pre-release 2, 1.16.2 Pre-release 3, 1.16.2 Release Candidate 1, 1.16.2 Release Candidate 2, 1.16.2, 1.16.3 Release Candidate 1, 1.16.3, 1.16.4 Pre-release 1, 1.16.4 Pre-release 2, 1.16.4 Release Candidate 1, 1.16.4, 20w45a, 20w46a, 20w48a, 20w49a, 20w51a, 21w03a, 1.16.5, 21w05a, 21w05b, 21w06a, 21w07a, 21w08b, 21w10a, 21w11a, 21w13a, 21w14a, 21w20a, 1.17 Pre-release 2, 1.17 Release Candidate 1, 1.17, 1.17.1, 21w39a, 21w40a, 1.18 Pre-release 1, 1.18 Pre-release 5, 1.18, 1.18.1 Pre-release 1, 1.18.1, 22w05a, 22w06a, 1.18.2, 22w12a, 22w14a, 22w17a, 1.19, 1.19.1 Release Candidate 1, 1.19.1 Pre-release 5, 1.19.2, 1.19.3, 1.19.4, 23w13a, 1.20.1, 23w32a
-
Confirmed
-
Entities, Hitboxes
-
Very Important
-
Platform
The bug
Mobs can attack you through blocks and corners due to miscalculation of attack radius.
How to reproduce
- Build a completely sealed off house with no windows or doors from opaque blocks like planks or cobblestone or the like, leave some blocks in the inventory for you to place in step 7.
- Make a two-block tall one-block wide empty doorway in the wall for you to go through and to seal off with blocks in step 7.
- Outside the house, spawn a Ravager.
- Switch to survival mode.
- The Ravager should start going for you.
- Run in the house, let it hit you once through the empty doorway.
- Seal off the doorway with two blocks.
Result: The Ravager is still able to hit the player, from about two blocks away, with a complete wall every possible place in between.
Expected: The Ravager can't attack the player any more.
Example
An example can be seen in this comment.
Old example
I just created a villager in MCEdit with the Create Shops filter to have a custom shop. I saved it and launched MC. The villager started to run around normally in his house but then he went to the door where a zombie was knocking at (wooden door on normal difficulty) and the villager blinked red and got damage and after a few hits he died. The zombie killed him through a closed door and the villager did not run away he always came back to the door until he died.
Additional informations
From kingsupernova:
There are a number of bug reports about attack radius that are all very similar. MC-2310, MC-18326, MC-50668, MC-63965, MC-71834, and MC-74907 are all about the attack radius of mobs extending through blocks. (Some mobs are more bugged than others, but it’s the same basic problem).
There are also a few related issues:
MC-1297is the same as the above, but for players.- MC-3059 is the same as the above, but for arrows.
Code analysis
Based on 1.11.2 decompiled using MCP 9.35 rc1
The problem seems to be the method net.minecraft.entity.ai.EntityAIAttackMelee.checkAndPerformAttack(EntityLivingBase, double) and methods overriding it. They all only test if the mob to attack is in a certain radius to the attacker without testing if blocks are between them.
Possible solutions
Bounding box check
The current behavior would be replaced by only allowing mobs to attack other mobs when their bounding boxes intersect.
Ray casting
The current behavior would be extended to require a ray cast from the attacker to the mob to attack (excluding liquids and blocks without collision box) to return no colliding blocks. Possible use y + height / 1.5 as attack height or have a method for mobs to define their attack height(s?). The height at which the mob to attack will be attacked could for example be y + height / 2 or with multiple tries depending on the height of the mob, for example
for (int attackFraction = 0; attackFraction < height / 2; attackFraction++) { double attackHeight = y + height * ((attackFraction + 1.0) / (height / 2.0 + 1.0)) }
- is duplicated by
-
MC-15127 Zombies can Hit NPCs Through Doors.
- Resolved
-
MC-18326 Hit by mob through solid wall
- Resolved
-
MC-20142 Zombies hit me through doors
- Resolved
-
MC-23919 Baby Zombies can attack through doors.
- Resolved
-
MC-24069 zombie glitch
- Resolved
-
MC-29270 Zombies can damage the player when breaking doors
- Resolved
-
MC-29292 Zombies can damage villagers through doors.
- Resolved
-
MC-40354 Door & Zombie bug
- Resolved
-
MC-40987 Zombies attack through doors
- Resolved
-
MC-50668 Mobs' Hitbox disregards Blocks
- Resolved
-
MC-63435 Zombies can attack villagers trough doors
- Resolved
-
MC-63965 Zombies can Attack Villagers through Fences
- Resolved
-
MC-69551 Zombies turn/harm villagers through iron doors
- Resolved
-
MC-70772 Zombies attack through doors
- Resolved
-
MC-71235 Baby Zombie hit player through door.
- Resolved
-
MC-71834 Video: Cave Spiders attack through solid floors when aggro on player
- Resolved
-
MC-73341 In mine craft, if a zombie is behind a door, and if you attack another npc near the zombie behind the door, it will walk up to the door, and is able to attack you from behind the door.
- Resolved
-
MC-74629 zombie through doors
- Resolved
-
MC-74905 mobs can interact with each other through doors,fences, and glass panes
- Resolved
-
MC-74907 Iron Golems can hurt players and mobs through walls
- Resolved
-
MC-77499 Spiders can attack through blocks and at a high distance when crowded
- Resolved
-
MC-79382 Zombies turning villagers through doors
- Resolved
-
MC-88647 Glitchy spiders hitting through wall
- Resolved
-
MC-92896 Mobs can STILL be hit through corners
- Resolved
-
MC-96693 Unable to attack mobs through closed doors, though there are holes in them.
- Resolved
-
MC-96860 Mobs continue to attack player when a villager closes door
- Resolved
-
MC-99135 Villagers dying in blocked doors.
- Resolved
-
MC-100083 Enemies with sword can attack through walls
- Resolved
-
MC-100129 Zombies can attack through the corners of blocks
- Resolved
-
MC-106854 zombies attacking through blocks
- Resolved
-
MC-106966 Zombies can attack through corners
- Resolved
-
MC-107078 Glitches
- Resolved
-
MC-110408 Certain mobs can attack diagonally
- Resolved
-
MC-116039 Cave spiders can hit the player through the floor.
- Resolved
-
MC-125826 Zombies can attack through doors
- Resolved
-
MC-126046 The spiders can attack you under a block that is below you
- Resolved
-
MC-129797 dolphins can hit
- Resolved
-
MC-131846 Phantoms can hit you through blocks.
- Resolved
-
MC-136341 Zombies Attack/Turn Villagers through doors
- Resolved
-
MC-137849 Illager Beast can attack through blocks
- Resolved
-
MC-138903 Pillager Beast
- Resolved
-
MC-139210 The "illager beast" can hit players through walls
- Resolved
-
MC-140962 new village style lets mobs kill villagers!
- Resolved
-
MC-143305 Zombies see and attack residents through the corner of the house.
- Resolved
-
MC-146425 Iron golem and ravager can attack their targets through walls.
- Resolved
-
MC-146545 a 1.14 Bug and it needs to be fixed fast
- Resolved
-
MC-147211 Enderman can hit you through the slab in survival.
- Resolved
-
MC-147928 Ravager can hit you through 1 block wall
- Resolved
-
MC-148521 Mini Zombies can attack you through closed doors
- Resolved
-
MC-151950 Ravagers are able to attack player through blocks from a distance of at least 3 blocks away
- Resolved
-
MC-152319 Ravanger can hit players through blocks
- Resolved
-
MC-152893 Spiders
- Resolved
-
MC-154751 Cave Spiders can hit you from a block
- Resolved
-
MC-154789 Pufferfish Deal damage through blocks
- Resolved
-
MC-154877 Mobs hitting through corners of walls.
- Resolved
-
MC-155446 Ravagers hit through blocks
- Resolved
-
MC-156313 Spider deals damage through half slabs
- Resolved
-
MC-158868 Ravager can hit and see through walls and hit box causes insane issue when trying to hit it.
- Resolved
-
MC-159479 Bees sting through Glass Panes
- Resolved
-
MC-161491 The Ravager is able to kill players thru buildings
- Resolved
-
MC-162382 Bees sting through glass panes
- Resolved
-
MC-162849 Iron golems can hurt players and mobs through walls
- Resolved
-
MC-164394 Pandas can attack through a full solid block
- Resolved
-
MC-167398 make the fence a complete block
- Resolved
-
MC-167784 Bees can attack through slim blocks
- Resolved
-
MC-168686 Died to Ravager in my home through wood blocks
- Resolved
-
MC-169158 Bee stung through glass pane
- Resolved
-
MC-169800 Iron Golem deals damage through the wall
- Resolved
-
MC-171356 Zombies can hit through doors
- Resolved
-
MC-172294 Bees sting through glass panes again (1.15.2)
- Resolved
-
MC-172863 Enderman hitting though wall
- Resolved
-
MC-172864 Enderman hitting though wall
- Resolved
-
MC-172939 Iron Golem attack not just through door, but a good 2.5-3 blocks through
- Resolved
-
MC-175374 Spider can hit up through blocks
- Resolved
-
MC-177256 Spiders beat the player through half blocks
- Resolved
-
MC-179312 Mobs hitting through walls
- Resolved
-
MC-181047 Pufferfish attacks through wall
- Resolved
-
MC-184710 Some mobs don't have appropriate "stopping ranges" when attempting to attack an enemy.
- Resolved
-
MC-186969 AFK bug or Alt+tab glitch
- Resolved
-
MC-188523 iron golem can hit the player from 1 block {if u in the house}
- Resolved
-
MC-190029 zombie atack villager through block
- Resolved
-
MC-192705 Bug where you can hit people with arrows through walls.
- Resolved
-
MC-192895 Zombies can attack through player-built cobblestone
- Resolved
-
MC-194971 Enemies can hit through blocks.
- Resolved
-
MC-195335 Zombified Piglin can attack through block corner
- Resolved
-
MC-196923 zombies can punch through fences
- Resolved
-
MC-198114 spiders can attack players through blocks
- Resolved
-
MC-198395 Bug in spiders
- Resolved
-
MC-198476 The Sweeping Attack can hit through corners
- Resolved
-
MC-199687 Spiders can hit through blocks
- Resolved
-
MC-201532 Spiders can be shot if they are right up against glass panes
- Resolved
-
MC-202151 so piglin brutes can hit through walls.
- Resolved
-
MC-202426 Zombies can hit through blocks
- Resolved
-
MC-207383 Damage Through Walls
- Resolved
-
MC-209036 Mobs able to get you through corners
- Resolved
-
MC-211507 Mobs are able to hit you through blocks
- Resolved
-
MC-211695 Mobs can hit you through walls with no blocks as a corner
- Resolved
-
MC-211873 mobs
- Resolved
-
MC-215294 Magma Cubes are Deadly
- Resolved
-
MC-217006 Iron Golems can hit you through blocks.
- Resolved
-
MC-217360 Zombies are hitting me through blocks when I crawl.
- Resolved
-
MC-218016 Mobs Hitting Players Through Walls
- Resolved
-
MC-218423 Endermen are broken. Please fix
- Resolved
-
MC-220315 zombie and the door bug
- Resolved
-
MC-220665 Attacked by zombified piglin through a wall
- Resolved
-
MC-224513 Endermen can attack diagonally through solid blocks
- Resolved
-
MC-227326 Spiders can attack player through slabs
- Resolved
-
MC-227631 Iron golems can hit you through wall
- Resolved
-
MC-228635 zombies hits me right through block
- Resolved
-
MC-229284 Spiders attacks through walls
- Resolved
-
MC-230134 i was play the new 1.17 when i found that spiders can hit me through solid blocks
- Resolved
-
MC-230627 Cave Spider Reach
- Resolved
-
MC-231751 Spiders can hit me through doors
- Resolved
-
MC-231753 Iron Golems can hit me Through walls
- Resolved
-
MC-233245 Spiders can hit the player from beneath a block
- Resolved
-
MC-241510 Spiders can go through walls
- Resolved
-
MC-241648 dead
- Resolved
-
MC-245806 Wither skeleton can hit the player through walls
- Resolved
-
MC-250268 Bees can sting you through doors and slabs
- Resolved
-
MC-253264 Ravagers can kill me through walls
- Resolved
-
MC-253637 Spiders can hit trough slabs/ground.
- Resolved
-
MC-258640 Ravagers hit through walls
- Resolved
-
MC-261497 Spiders being able to attack through Stairs
- Resolved
-
MC-261906 iron golems kill zombie villagers and zombies throught walls
- Resolved
- relates to
-
MC-198068 Some entities randomly stop attacking or fleeing during pathfinding
- Reopened
-
MC-93478 End Portal teleport range is too large(Portal corner and bottom)
- Resolved
-
MC-108937 Attack ranges for certain mobs are incorrect
- Resolved
-
MC-264915 Some mobs can still attack you through blocks
- Resolved
-
MC-116644 Filled water or powder snow cauldron extinguishes burning arrows that hit either side of the cauldron
- Open
-
MC-146524 Certain mobs attack while the player is in creative or spectator mode
- Open
-
MC-252697 Frog can use its tongue to hurt the entity behind it when it's on a boat, boat with chest, bamboo raft or bamboo raft with chest
- Open
-
MC-252706 Ravager can ram with their head and roar to attack the enemy behind when it's on boats, boats with chest, bamboo raft or bamboo raft with chest
- Open
-
MCPE-162607 Polar bear attacks passing through blocks
- Open
-
MC-3059 Projectiles can pass through thin surfaces
- Reopened
-
MC-97042 Villagers not opening the correct door.
- Resolved
-
MC-101015 Can use dismount to go through the wall
- Resolved
-
MC-265029 Projectiles can enter the portal through the corners of the block
- Resolved
-
MC-265134 Pufferfish can sting entities through blocks
- Resolved
-
MCPE-66294 Creatures can attack through glass panes
- Resolved
-
MC-1297 You can attack and be attacked through glass panes
- Resolved