Mojira Archive
MC-202384

Villagers/Wandering traders double their Inventories when NBT reload

When you edit/modify/produce an NBT reload of a villager or wandering trader, its inventory gets doubled. For example 1 bread turns into 2, 2 stacks of 20 seeds turn into 2 stacks of 40 seeds, 50 <item> turn into 100 <item> (a new stack is generated for storing the extra 36).

 

Reproduction steps:

1. Spawn a villager and give him any items you want (remember they can pick up food)

2. Check his inventory with

/data get entity @e[type=minecraft:villager,limit=1,sort=nearest] Inventory

3. Update his NBT with any command, for example

/data merge entity @e[type=minecraft:villager,limit=1,sort=nearest] {Health:15.0f}
/data modify entity @e[type=minecraft:villager,limit=1,sort=nearest] Health set value 5.0f

4. Check his inventory again. All items are doubled.

 

If you try to modify the Count of one of his items, the result will be NewCount = InputCount + OldCount (instead of just NewCount = InputCount).

If you try to modify the ID of one of his items, the result will be 1 stack of old item + 1 stack of input item (instead of just 1 stack of input item).

 

Duplicate

FACS01

2020-10-19, 09:11 AM

2020-11-04, 05:53 PM

2020-10-19, 07:51 PM

0

2

Unconfirmed

(Unassigned)

NBT, inventory, villager, wandering_trader

1.16.3, 1.16.4 Pre-release 1

-