$summon text_display ~ ~ ~ {CustomName:"",billboard:"fixed",transformation:{left_rotation:[0f,0f,0f,1f],right_rotation:[0f,0f,0f,1f],translation:[0f,0f,0f],scale:[0f,0f,0f]},Tags:[capturename],text:[{"italic":false,"text":"Capture Bag ["},{"italic":false,"selector":"@n[nbt={UUID:$(UUID)}]"},{"italic":false,"text":"]"}]}
execute unless data entity @s {CustomName:{"text":"Capture Bag","italic":false}} run data modify entity @n[tag=capturename] CustomName set from entity @s CustomName
execute if data entity @s CustomName unless data entity @s {CustomName:{"text":"Capture Bag","italic":false}} run data merge entity @n[tag=capturename] {billboard:"center"}