Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-159946

/data works incorrectly with villager inventory

XMLWordPrintable

    • Unconfirmed
    • Commands

      When trying to modify villager inventory with /data (specifically the item Count) it always either adds or duplicates the value.

      How to recreate:

      1. /summon villager
      2. Drop some items that villager can pick up (in this case 3 potatoes)
      3. /data get entity @e[type=villager,sort=nearest,limit=1] Inventory
        The item Count will show 3
      4. /data modify entity @e[type=villager,sort=nearest,limit=1] Inventory[0].Count set value 1
        /data get entity @e[type=villager,sort=nearest,limit=1] Inventory
        The Count now will be 4
      5. /data modify entity @e[type=villager,sort=nearest,limit=1] Inventory insert 0 value {}
        /data get entity @e[type=villager,sort=nearest,limit=1] Inventory
        Item Count is now doubled and shows 8
      6. /data modify entity @e[type=villager,sort=nearest,limit=1] Inventory append value {id:"minecraft:wheat",Count:1b}
        /data get entity @e[type=villager,sort=nearest,limit=1] Inventory
        The potato Count is now doubled again and shows 16
        if this step is repeated the values will double again, showing 32 potatoes in slot 0 and 3 wheat in slot 1, one more and counts will be 64 and 7

            Unassigned Unassigned
            GoblinSpore Andrey
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: