An allay which has been given an item cannot normally be injured by the player who gave it the item; however, a sword with Sweeping Edge and Fire Aspect sets the allay on fire if it is caught in the line of the sweep attack.
In my case, I used a Sweeping Edge III sword with Fire Aspect. (I tested afterwards, and I could not hit the allay directly with the sword.) This occurred repeatedly when fighting groups of zombified piglins, blazes and wither skeletons. I am unsure if this applies to swords without Fire Aspect.
Linked issues
duplicates 1
Attachments
Comments 2
Thank you for your report!
We're tracking this issue in MC-272994, so this ticket is being resolved and linked as a duplicate.
That ticket has already been resolved as Fixed. Please check the Fix Version/s field in that ticket to see in which version this behavior was or will be fixed.
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 – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
Duplicate of MC-272994; already fixed in 24w45a.