scoreboard players remove @s c4Timer 1

execute if score @s c4Timer matches 0..20 run particle smoke ~ ~ ~ 0 1 0 0.1 0 force
execute as @a if score @s playerID = @n[type=item_display,distance=0..1] playerID if score @n[type=item_display,distance=0..1] c4Timer matches 20..40 run particle dust{color:[1.000,0.000,0.000],scale:1} ~ ~ ~ 0 0 0 1 0 force @s
execute as @a if score @s playerID = @n[type=item_display,distance=0..1] playerID if score @n[type=item_display,distance=0..1] c4Timer matches 40..70 run particle dust{color:[1.000,0.400,0.051],scale:1} ~ ~ ~ 0 0 0 1 0 force @s
execute as @a if score @s playerID = @n[type=item_display,distance=0..1] playerID if score @n[type=item_display,distance=0..1] c4Timer matches 70..100 run particle dust{color:[1.000,0.631,0.078],scale:1} ~ ~ ~ 0 0 0 1 0 force @s

execute if score @s c4Timer matches 5 run playsound ui.button.click ambient @a ~ ~ ~ 1 2
execute if score @s c4Timer matches 0 run playsound ui.button.click ambient @a ~ ~ ~ 1 2
execute if score @s c4Timer matches -5 run playsound ui.button.click ambient @a ~ ~ ~ 1 2
execute if score @s c4Timer matches -8..5 at @s run tp @s ~ ~0.17 ~ ~12 ~
execute if score @s c4Timer matches -8 at @s run tp @s ~ ~-2 ~ ~-24 ~
execute if score @s c4Timer matches -10 run function subchronos:game/items/c4/explode