tag @s add has_flag
tag @s add has_light_purple_flag

item replace entity @s armor.head with magenta_wool[item_name={"color":"light_purple","italic":false,"text":"Magenta Flag"},enchantments={"minecraft:binding_curse":1}] 1

title @a[distance=..250] times 5 60 10
title @a[distance=..250] subtitle ["",{"selector":"@s","bold":true},{"text":" has stolen the "},{"text":"Magenta Flag","bold":true,"color":"light_purple"},{"text":"!"}]
title @a[distance=..250] title ""

scoreboard players add @s flags_stolen_this_game 1

particle minecraft:firework ~ ~1 ~ 0 0 0 0.5 50
playsound minecraft:item.goat_horn.sound.3 player @a ~ ~ ~ 20 1
kill @n[type=interaction,tag=light_purple_interaction]
kill @n[type=block_display,tag=light_purple_flag]

team modify light_purple_wool prefix {"text":"▒ ","color":"light_purple"}