data command duplicates villager and piglin inventories
A successful entitydata, with white text output, will duplicate the villager inventory – after the text is displayed. The white displayed text is the old value, before the duplication. To see the duplication, you have to use another entitydata command. It's best to use a failed one, with red text, as red text doesn't cause further duplication.
- Summon a Villager:
- /summon Villager
- Give him 3 seeds:
- /replaceitem entity @e[type=Villager,c=1] slot.villager.0 wheat_seeds 3
- Check his inventory with a failed, red entitydata command. Notice Count:3b (near the end of the NBT) for the 3 seeds:
- /entitydata @e[type=Villager,c=1] {}
- Do it again, and notice Count:3b again. Nothing has changed yet.
- /entitydata @e[type=Villager,c=1] {}
- Now use entitydata to change his name. The white text will display Count:3b, but it's lying!
- /entitydata @e[type=Villager,c=1] {CustomName:TestGuy}
- Use a failed, red command to check his inventory. It shows Count:6b.
- /entitydata @e[type=Villager,c=1] {}
- Do it again. Still Count:6b.
- /entitydata @e[type=Villager,c=1] {}
- Use another successful entitydata. It will display Count:6b, but it's lying!
- /entitydata @e[type=Villager,c=1] {Glowing:true}
- Use a failed, red command to check his inventory. It shows Count:12b.
- /entitydata @e[type=Villager,c=1] {}
- Do it again. Still Count:12b.
- /entitydata @e[type=Villager,c=1] {}
2017-01-26, 09:47 AM
2023-11-10, 08:06 AM
2017-01-26, 10:06 AM
0
12
-