mojira.dev
MC-47699

Blazes are able to see a player through blocks

The bug

When the player attacks a blaze, nearby blazes behind solid walls will turn hostile and shoot at the player as if the wall wasn't there. Those blazes also continue to attack when the player has switched to Creative mode, whereas all blazes that initially had line-of-sight to the player will stop attacking.

Code analysis

The following analysis is based on a decompiled version of Minecraft using MCP 9.40pre-1 with MC 1.12.2 mappings (guide by @unknown here)

As per net.minecraft.entity.monster.EntityBlaze.initEntityAI(), a blaze's entityCallsForHelp boolean in the net.minecraft.entity.ai.EntityAIHurtByTarget class is always set to true, which means that it will alert other blaze entities within its followRange as soon as it gets attacked. The method which is called when a blaze wants to alert their fellow blazes is net.minecraft.entity.ai.EntityAIHurtByTarget.alertOthers().

This method, however, does not check if there are any blocks in between the attacking entity and the alerted blaze. So, I quickly made a hacky for-loop to check if there are any blocks other than air in between the entities' coordinates. Albeit I absolutely do not recommend to use this code as it is wacky as hell and does not consider all blocks within the view of the alerted blaze, it does a decent job in showing what the issue is – so I'll post it here anyway if anyone wants to test this.

Linked issues

Attachments

Comments 77

I can confirm that, blaze also track/attack trough halfslabs, very annoying.

This is part of their new AI, so it works as intended.

I get the point with glass and other blocks a blaze could possibly see you trough, but not halfslabs. And I mean trough a solid floor/ceiling of halfslabs, not a wall with gaps. It's just annyoing as hell.

Blazes are seeing and firing at me through ANY block. While this IS part of the zombie AI, it doesn't make sense for Blazes since they should be smart enough to not shoot at something through an obstacle.

I can totally confirm this, even in snapshot 14w08a, when you aggro a blaze, then move behind a wall, the blaze will continue to shoot you as if you aren't behind a wall at all. It is definately not intended, as before their AI change, they would go around a corner to shoot at you. This just makes no sense. Also in a separate issue, Blazes won't shoot you past 16 blocks. This is really strange, definately not intended.

67 more comments

@unknown, 1.14.3 has not been released yet.

Most of the aggravation is fixed, but the blazes still track players through solid blocks without attacking, it's like a group of bees swarming after you.
1.14.3 pre-release 3

This is the same bug, only the part of attacking has been removed. in pre-release 3 of 1.14.3

MC-160119 - this bug was never fixed; would be nice if this would actually get some attention and be FULLY fixed instead of just half-arsed.

Céleste

Sonicwave

migrated

Confirmed

Important

Mob behaviour

Minecraft 14w06b, Minecraft 14w20b, Minecraft 14w21b, Minecraft 14w27b, Minecraft 14w28a, ..., Minecraft 1.14.2 Pre-Release 2, Minecraft 1.14.2 Pre-Release 4, Minecraft 1.14.2, Minecraft 1.14.3 Pre-Release 1, Minecraft 1.14.3 Pre-Release 2

Minecraft 1.14.3 Pre-Release 3

Retrieved