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.
Linked issues
Comments 1

Thank you for your report!
We're tracking this issue in MCPE-70614, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki