The Motion tag of mobs with the NoAI tag set to true is still affected by attacks, water, players or mobs moving through them, and anything else that might affect their velocity. As a result, when such a mob has its NoAI tag set to false, it immediately performs all of its accumulated movement.
How to reproduce:
The attached data pack ([mediaInline]) contains a game test that reproduces this issue. It can be run by executing this command:
/test run mc-303390:testTo reproduce the issue manually instead, follow these steps:
Execute the following command:
/summon minecraft:creeper ~ ~1 ~ {NoAI:1b}Move through or punch the summoned creeper a few times, or run water through it and wait a few seconds.
Execute the following command:
/data get entity @n[type=minecraft:creeper] Motion→ ❌ The value is not very close to 0 on all axes.
Execute the following command:
/data merge entity @n[type=minecraft:creeper] {NoAI:0b}→ ❌ The creeper moves towards the direction its movements accumulated to.
Expected result:
Mobs with no AI would not be affected by anything causing movement to them.
Observed result:
Mobs with no AI accumulate all movement they try to make and perform all of it when given their AI back.
Confirmed on 1.21.11-rc2