Piglins shooting at you if you replace their weapon
Issue
A piglin holding a crossbow will shoot at you if you replace their item with a melee weapon.
How to recreate
- Summon a piglin with either a spawn egg or "/summon piglin ~ ~ ~"
- Ensure that the piglin you spawned is holding a crossbow
- Use command "/replaceitem entity @e[type=piglin] slot.weapon.mainhand 0 wooden_sword"
- Switch gamemode to "/gamemode s"
Expected outcome
The piglin should chase the player with their wooden sword.
Actual outcome
The piglin uses ranged attacks as if it were holding a crossbow, shooting mysterious arrows from their chest.