scoreboard players remove @s invulnerable_timer 1

execute unless score @s invis_timer matches 1.. run particle minecraft:electric_spark ~ ~1 ~ 0.25 0.25 0.25 1 3 force @a[distance=1..]
particle minecraft:electric_spark ~ ~1 ~ 0.25 0.25 0.25 1 3 force @s

function pctf:fx/rainbow_dust/summon {x: "~", y: "~1", z: "~", spread_x: 0.25, spread_y: 0.5, spread_z: 0.25, scale: 1.0, count: 8, f_or_n: "normal", viewer: "@a[distance=2..]"}
function pctf:fx/rainbow_dust/summon {x: "~", y: "~1", z: "~", spread_x: 0.25, spread_y: 0.5, spread_z: 0.25, scale: 0.5, count: 5, f_or_n: "normal", viewer: "@a[distance=..2]"}

execute if score @s invulnerable_timer matches 1 run function pctf:logic/items/lucky_block/effects/invulnerable/end