YOU SAID:
When my friend I died I was sad.
INTO JAPANESE
私の友人は私が死んだときは悲しかった。
BACK INTO ENGLISH
When a friend of mine died I was sad.
INTO JAPANESE
私の友人が死んだときは悲しかった。
BACK INTO ENGLISH
It was sad when my friend died.
INTO JAPANESE
私の友人が死んだときは悲しかった。
BACK INTO ENGLISH
It was sad when my friend died.
That didn't even make that much sense in English.