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

Mob item pick up behavior is not distinct resulting in mobs constantly dropping and picking up items

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 24w45a
    • 1.16.1, 20w28a, 20w29a, 20w30a, 1.16.2 Pre-release 1, 1.16.2 Release Candidate 1, 1.16.2 Release Candidate 2, 1.16.2, 1.16.3 Release Candidate 1, 1.16.3, 1.16.4 Pre-release 2, 1.16.4, 20w45a, 20w51a, 21w03a, 1.16.5, 21w08b, 1.17, 1.19.2, 1.19.4 Pre-release 1, 1.19.4, 1.20.1, 1.20.4
    • None
    • Confirmed
    • Mob behaviour
    • Low
    • Gameplay

      The bug

      Mobs with CanPickUpLoot:1b do not have distinct rules for when to pick up items. Instead they constantly switch an undamaged item with a damaged item of the same type with additional NBT (e.g. enchantments, custom name, ...).

      This is a clone of MC-113131, however it appears there were some versions including 1.15.2 where mobs did not prefer items with NBT. This might have been fixed by MC-174359.
      The code analysis of MC-113131 is likely still relevant.

      Results on a survival: https://www.reddit.com/r/Minecraft/comments/iao4p3/i_just_finished_afking_at_my_new_gold_farm_when_i/

      Example videos:

      How to reproduce

      1. Summon a mob which can pick up items
        /summon husk ~ ~ ~ {CanPickUpLoot:1b}
        
      2. Set the mobGriefing gamerule to true if it is not already
        /gamerule mobGriefing true
        
      3. Throw an undamaged chestplate at the mob
        /give @p diamond_chestplate
        
      4. Throw a damaged chestplate (with NBT) at the mob
        /give @p diamond_chestplate{Enchantments:[{id:unbreaking,lvl:1s}],Damage:1}
        

        The mob constantly swaps the items

            Unassigned Unassigned
            BotPokey BotPokey
            Votes:
            20 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: