Piglins prefer using an unenchanted gold item instead of an enchanted gold item
The bug
Piglins with unenchanted golden swords don't seem to switch their current weapon to an enchanted one. They'll just put it in their inventory after inspecting or contemplating the enchanted gold item, this works with armor as well. I'm unsure whether this is intended.
How to reproduce
- Summon a piglin with a golden sword
- Have an enchanted golden sword and drop it near the piglin
- The piglin inspects the enchanted gold item
→
The piglin does not switch to an enchanted item.
Created Issue:
Piglins prefer using an unenchanted gold item instead of an enchanted gold item
The bug
Piglins with unenchanted golden swords don't seem to switch their current weapon to an enchanted one. They'll just put it in their inventory after inspecting or contemplating the enchanted gold item, this works with armor as well. I'm unsure whether this is intended.
How to reproduce
- Summon a piglin with a golden sword
- Have an enchanted golden sword and drop it near the piglin
- The piglin inspects the enchanted gold item
→The piglin does not switch to an enchanted item.
The bug
Relates to MC-174359.
Though it's a crossbow and not gold, piglins don't change their current crossbows to a enchanted one.
How to reproduce
- Summon a piglin
- Have an unenchanted crossbow and drop it near the piglin
→
The piglin picks up the crossbow - Have an enchanted crossbow and drop it near the piglin
→
The piglin ignores the enchanted crossbow.
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
- Summon a mob which can pick up items
/summon husk ~ ~ ~ {CanPickUpLoot:1b} - Set the mobGriefing gamerule to true if it is not already
/gamerule mobGriefing true - Throw an undamaged chestplate at the mob
/give @p diamond_chestplate
- 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