execute store result score @s vb.dummy1 run random value 1..20

execute if score @s vb.dummy1 matches 1 run particle soul ~ ~0.9 ~ 0.2 0.5 0.2 0 1
execute if score @s vb.dummy1 matches 1..10 run particle soul_fire_flame ~ ~0.9 ~ 0.2 0.5 0.2 0 1

particle dust_color_transition{from_color:[0.25,0.25,0.25],to_color:[0.0,0.0,0.0],scale:1} ~ ~1 ~ 0.2 0.3 0.2 0 5
particle dust_color_transition{from_color:[0.25,0.25,0.25],to_color:[0.0,0.0,0.0],scale:1} ~ ~0.7 ~ 0.15 0.1 0.15 0 3
particle dust_color_transition{from_color:[0.25,0.25,0.25],to_color:[0.0,0.0,0.0],scale:1} ~ ~0.5 ~ 0.1 0.1 0.1 0 3
particle dust_color_transition{from_color:[0.25,0.25,0.25],to_color:[0.0,0.0,0.0],scale:1} ~ ~0.3 ~ 0 0.1 0 0 3

## Trigger ambient sounds
scoreboard players add @s vb.timer.ambient_sound 1
execute store result score @s vb.dummy1 run random value 1..110
execute if score @s vb.timer.ambient_sound matches 80.. if score @s vb.dummy1 matches 1 run function vb:tick_entity/custom_mob/wraith/ambient_sound

## Hurt
execute store result score @s vb.dummy1 run data get entity @s HurtTime
execute if score @s vb.dummy1 matches 1.. run function vb:tick_entity/custom_mob/wraith/hurt
