How to drop playerhead of certain player
So i am creating a datapack that drops playerhead of that player when they die in the hands of a player and later do other stuffs. I am checking death of player with advancement and then the advancement runs a function where there is this code
summon item ~ ~ ~ {Item:{id:"minecraft:player_head", Count:1b}}(it is to drop the player head but the main problem is i want to drop the player head of that player who died so i want theSkullOwnervalue to be that player name)