I haven't tried this with other players. To recreate this, a bow, whether enchanted or not, is needed, and Instant Damage II arrow(s). Then, try to hit yourself with the arrow(s) until you die. I have provided an image of the death screen when you die like this. The exact death message is:
death.attack.magic.player
Doesn't work in 1.17.1. maybe i should try in 1.14.1