Tool holding {CanPickUpLoot:1b} mobs only pick up swords
The bug
As in the title.
Even if they are holding a wooden shovel and you give a diamond shovel, they will never pick it up. However, they will can pick up a wooden sword.
How to reproduce
- Use the following command
/summon husk ~ ~ ~ {CanPickUpLoot:1b,HandItems:[{id:"iron_shovel",Count:1b},{}]} - Set the mobGriefing gamerule to true if it is not already
/gamerule mobGriefing true - Throw a diamond shovel at the husk
→ It won't pick it up - Throw a wooden sword at it
→ It picks it up despite the sword being weaker (4 attack damage) than the iron shovel (4.5 attack damage)
Created Issue:
Tool holding {CanPickUpLoot:1b} mobs only pick up swords
As in the title.
Even if they are holding a wooden shovel and you give a diamond shovel, they will never pick it up. However, they will can pick up a wooden sword.Environment
macOS Sierra 10.12.1 Beta
macOS Sierra 10.12.1 Beta
The bug
As in the title.
Even if they are holding a wooden shovel and you give a diamond shovel, they will never pick it up. However, they will can pick up a wooden sword.How to reproduce
- Use the following command
/summon husk ~ ~ ~ {CanPickUpLoot:1b,HandItems:[{id:"iron_shovel",Count:1b},{}]}- Throw a diamond shovel at the husk
→ It won't pick it up- Throw a wooden sword at it
→ It picks it up despite the sword being weaker (4 attack damage) than the iron shovel (4,5 attack damage)
The bug
As in the title.
Even if they are holding a wooden shovel and you give a diamond shovel, they will never pick it up. However, they will can pick up a wooden sword.How to reproduce
- Use the following command
/summon husk ~ ~ ~ {CanPickUpLoot:1b,HandItems:[{id:"iron_shovel",Count:1b},{}]}- Set the mobGriefing gamerule to true if it is not already
/gamerule mobGriefing true- Throw a diamond shovel at the husk
→ It won't pick it up- Throw a wooden sword at it
→ It picks it up despite the sword being weaker (4 attack damage) than the iron shovel (4,5 attack damage)
The bug
As in the title.
Even if they are holding a wooden shovel and you give a diamond shovel, they will never pick it up. However, they will can pick up a wooden sword.How to reproduce
- Use the following command
/summon husk ~ ~ ~ {CanPickUpLoot:1b,HandItems:[{id:"iron_shovel",Count:1b},{}]}- Set the mobGriefing gamerule to true if it is not already
/gamerule mobGriefing true- Throw a diamond shovel at the husk
→ It won't pick it up- Throw a wooden sword at it
→ It picks it up despite the sword being weaker (4 attack damage) than the iron shovel (4,5 attack damage)The bug
As in the title.
Even if they are holding a wooden shovel and you give a diamond shovel, they will never pick it up. However, they will can pick up a wooden sword.How to reproduce
- Use the following command
/summon husk ~ ~ ~ {CanPickUpLoot:1b,HandItems:[{id:"iron_shovel",Count:1b},{}]}- Set the mobGriefing gamerule to true if it is not already
/gamerule mobGriefing true- Throw a diamond shovel at the husk
→ It won't pick it up- Throw a wooden sword at it
→ It picks it up despite the sword being weaker (4 attack damage) than the iron shovel (4.5 attack damage)
Resolving to MC-108124.
Confirmed for
How to reproduce
/summon zombie ~ ~ ~ {CanPickUpLoot:1b,HandItems:[{id:"iron_shovel",Count:1b},{}]}→ It won't pick it up
→ It picks it up despite the sword being weaker (4 attack damage) than the iron shovel (4,5 attack damage)
I think they are picking higher number of (attack speed)x(attack damage). If you try to give them a wooden sword when holding a iron shovel, they will pick it up. Can anyone confirm it?
Roy Sajima
No. Mobs use the following rules to know if they should pickup a hand Item :
The base damage of a sword is calculated from his material, so his attackDamage and attackSpeed attributes are ignored.
A shovel or an axe are treated the same way as a stick.
These rules were written before attributes, but now that some tools are kinda considered weapons, this should be changed.
The zombies actually prefer worse damage values.
MC-44283Duplicates
MC-104880(or vice versa)Relates to
MC-44283like [~FaRoGaming] saidIt would be really handy if tools were compared based on (attack speed)x(attack damage), the behavior which @Roy Sajima expected. This would allow mob-based sorting systems of hoes, axes, pickaxes, and shovels, the tools most commonly used in the game. Bows should ideally also be accounted for; a less damaged bow should be picked up over a more damaged one, for instance.
It would also be nice if enchantments were taken into account when comparing equipment, either on a "actual damage/armor value" basis or maybe the sum of enchanting levels present on the items.
I can no longer reproduce this bug.
I am also no longer able to reproduce this issue in 21w03a.
I'm unable to reproduce this in 21w03a.