execute if entity @s[tag=has_flag] as @n[tag=lucky_block] at @s run return run function pctf:logic/items/lucky_block/outcomes/reroll
execute at @e[tag=flag_location,sort=random,limit=1,distance=..250] run tp @s ~ ~1 ~
execute at @s run playsound minecraft:entity.player.teleport player @a ~ ~ ~ 2 1
execute at @s run particle minecraft:witch ~ ~ ~ 0.5 0.5 0.5 0.01 100 force @a
tellraw @s {"text":"Whoa! You teleported to a random flag location!","color":"gold"}