Normaly mobs that can pick up loot will only swap out their weapon if it’s better than what they have. but with new gold spear zombie piglin, they swap it with any item even worse things.
Linked issues
relates to 1
testing discovered 1
Attachments
Comments 3
It says all the spears have 1 or more attack damage. Also the bug is about them dropping their weapon to pick up useless stuff like rotten flesh. All mob that spawn with spears seem to have this problem.
Players holding any regular item have 1 attack damage. Item tooltip reports that total damage when dealt by player, so for wooden and golden spears, that’s also 1 (total, including player dealt damage). So any rotten flesh is as good for direct damage as golden or wooden spear. Mobs in general only compare weapon items by their attack damage and it is by design that wooden or golden spears are as good as rotten flesh.
I know that understanding game mechanics might be difficult at time especially if the feedback the game does is confusing, but I am glad to see you using the trick I discovered!
Our fix was as follows:
- fixed calculation making sure only damage modifiers are used when calculating how good an item is as a weapon
- allowing piglins to prefer golden spears, as they prefer crossbows, allowing them always to pick it up.
- for the remaining mobs, including all zombies, they still use the damage based calculation, so if they hold wooden or golden spears it is as good as any other item.
Golden spear provides +0 attack damage, so it is correct that any item will be as good as the golden spear. We decided that the piglins recognize the utility of golden spears and will pick them up more eagerly, but all undead that wield the spear will use existing logic of attribute comparison, meaning they can be tricked to dropping it off.