mojira.dev
MC-152202

Updating villager NBT resets his AI

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

  1. 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

Comments 4

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

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.

It seems this confirmed bug doesn't have a priority assigned yet

FACS01

(Unassigned)

Confirmed

Entities

AI, villager, wandering_trader

Minecraft 1.14.2 Pre-Release 2, Minecraft 1.14.2 Pre-Release 3, Minecraft 1.14.2, Minecraft 1.14.3 Pre-Release 2, Minecraft 1.14.3 Pre-Release 3, ..., 21w07a, 21w10a, 21w11a, 1.17, 1.17.1 Pre-release 1

Retrieved