
tag @s add sgrave.getting_name

summon text_display ~ ~ ~ {Tags:["sgrave.get_name"],text:{"selector":"@p[advancements={snapgrave:is_dead=true},tag=sgrave.getting_name]"}}
data modify storage sgrave:temp player_name set from entity @n[type=minecraft:text_display,tag=sgrave.get_name] text.text
kill @e[type=text_display,tag=sgrave.get_name]

tag @s remove sgrave.getting_name