tag @s add has_flag
tag @s add has_green_flag

item replace entity @s armor.head with lime_wool[item_name={"color":"green","italic":false,"text":"Green 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":"Green Flag","bold":true,"color":"green"},{"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=green_interaction]
kill @n[type=block_display,tag=green_flag]

team modify green_wool prefix {"text":"▒ ","color":"green"}