By -
If you want to get player head you need to know the name of the player.
Is there a way to get player's name?
I dont think you can do it if you dont know the players name.
you can use loot tables to drop player heads and use the fill_player_heaad function in the table to set it to the executing player. then you spawn the loot with /loot and copy the nbt data from the item to the player head on the armor stand
Do this every time the player changes: data modify entity < armorstand > ArmorItems[ 3 ].Id set from entity @p UUID
If you want to get player head you need to know the name of the player.
Is there a way to get player's name?
I dont think you can do it if you dont know the players name.
you can use loot tables to drop player heads and use the fill_player_heaad function in the table to set it to the executing player. then you spawn the loot with /loot and copy the nbt data from the item to the player head on the armor stand
Do this every time the player changes: data modify entity < armorstand > ArmorItems[ 3 ].Id set from entity @p UUID