setting armor stand to player name...
Im trying to make a datapack for a server (because Im not doing plugins) and Im trying to make a function that spawns in an armor stand, then sets its name to the player's name, but it doesn't work.
heres the code:
execute as @e[tag=t, limit=1, sort=nearest, type=armor_stand] run data modify entity @s CustomName set from entity @p tag @e[tag=t, limit=1, sort=nearest, type=armor_stand] remove t```