The Bug
When you update a villager's NBT using commands, his AI gets reset, This does not appear to happen to other mobs.
Video showing the bug: https://www.youtube.com/watch?v=B4gZznIjL1Q
Steps to reproduce
Put the following command in a repeating command block and activate it:
/execute as @e[type=minecraft:villager] run data modify entity @s dummy_test_value set value '[{"text":"1"}]'
-> ❌ The AI of the villager gets reset every tick.
A second video testing another NBT data: https://www.youtube.com/watch?v=jqTGtlsZWIw
Linked issues
relates to 2
Comments 4
I put a creeper on the same test (changing its name fast) and its AI didn't get stuck, it followed me (in survival) and tried to explode.
I'll test other tags with villagers if necessary, but consider that thing with the creeper first.
I mean, if this don't happen with creepers, why should with villagers? it's not an useful behaviour
@tryashtar you were right, it seems that the bug happens when NBT reloads, it's not just because of changing their names.
When you change the Tags data for example, it also triggers the bug:
https://www.youtube.com/watch?v=jqTGtlsZWIw
But in my tests I couldn't find another entity that happens the same when updating its NBT, it just happens to villagers and wandering traders. That means that the bug is inside the villagers AI and is not part of NBT reload of all entities.
Please fix it.
I believe this is just caused by the NBT reload in general, and would therefore be considered "won't fix".
Unless of course you can show that either
repeatedly using a name tag causes the same issue; or
repeatedly changing a different tag does not cause this issue.
Let me know if either of those are true please