Mojira Archive
MC-102965

Walking mobs don't use pathfinding when using NoGravity tag

Mobs which have to walk to attack or flee from the player don't seem to move anymore when they are using the NoGravity-tag. The only mob able to move and attack the player is the skeleton.

What I expected to happen was...:
The mobs would float in the air and at least try to attack me.

What actually happened was...:
They just stand/float on their spot and don't move.

Steps to Reproduce:

  1. Put up a repeating commandblock with the command
    execute as @e run data merge entity @s {NoGravity:1b}
    
  2. Activate the commandblock
  3. Spawn in some zombies
  4. Switch into survival mode
  5. Notice how they don't try to attack you

Note: If you spawn in zombies before you switch on the commandblock and they try to attack you and THEN you activate the commandblock, they will suddenly spin in their spot. If you walk to them they will hit you once and get knocked back, however afterwards they won't deal damage anymore.
Note 2: If you move near creepers, they will still explode.

Code analysis

Code analysis by [Mod] Avoma can be found in this comment.