execute if entity @a[scores={revenant_head_grab_dur=1..}] run schedule function kiwi3:relics/revenant_head/revenant_head_grabbing 1t

execute as @a[scores={revenant_head_grab_dur=1..}] at @s run tp @e[type=#enemy_mobs_only,tag=!limitbreak_starting_mob,tag=!limitbreak_continue_mob,limit=1,sort=nearest,distance=..3] ^ ^ ^0.5 facing entity @s
execute as @a[scores={revenant_head_grab_dur=80}] at @s run playsound entity.phantom.bite player @a[distance=..4] ~ ~ ~ 1 0.75
execute as @a[scores={revenant_head_grab_dur=60}] at @s run playsound entity.phantom.bite player @a[distance=..4] ~ ~ ~ 1 0.75
execute as @a[scores={revenant_head_grab_dur=50}] at @s run playsound entity.phantom.bite player @a[distance=..4] ~ ~ ~ 1 0.75
execute as @a[scores={revenant_head_grab_dur=20}] at @s run playsound entity.phantom.bite player @a[distance=..4] ~ ~ ~ 1 0.75
execute as @a[scores={revenant_head_grab_dur=1}] at @s run playsound entity.phantom.bite player @a[distance=..4] ~ ~ ~ 1 0.75
execute as @a[scores={revenant_head_grab_dur=80}] at @s at @e[type=#enemy_mobs_only,tag=!limitbreak_starting_mob,tag=!limitbreak_continue_mob,limit=1,sort=nearest,distance=..3] run particle block_crumble{block_state:redstone_block} ~ ~1 ~ 0.5 0.7 0.5 1 20
execute as @a[scores={revenant_head_grab_dur=60}] at @s at @e[type=#enemy_mobs_only,tag=!limitbreak_starting_mob,tag=!limitbreak_continue_mob,limit=1,sort=nearest,distance=..3] run particle block_crumble{block_state:redstone_block} ~ ~1 ~ 0.5 0.7 0.5 1 20
execute as @a[scores={revenant_head_grab_dur=40}] at @s at @e[type=#enemy_mobs_only,tag=!limitbreak_starting_mob,tag=!limitbreak_continue_mob,limit=1,sort=nearest,distance=..3] run particle block_crumble{block_state:redstone_block} ~ ~1 ~ 0.5 0.7 0.5 1 20
execute as @a[scores={revenant_head_grab_dur=20}] at @s at @e[type=#enemy_mobs_only,tag=!limitbreak_starting_mob,tag=!limitbreak_continue_mob,limit=1,sort=nearest,distance=..3] run particle block_crumble{block_state:redstone_block} ~ ~1 ~ 0.5 0.7 0.5 1 20
execute as @a[scores={revenant_head_grab_dur=1}] at @s at @e[type=#enemy_mobs_only,tag=!limitbreak_starting_mob,tag=!limitbreak_continue_mob,limit=1,sort=nearest,distance=..3] run particle block_crumble{block_state:redstone_block} ~ ~1 ~ 0.5 0.7 0.5 1 20
execute as @a[scores={revenant_head_grab_dur=80}] at @s run damage @e[type=#enemy_mobs_only,tag=!limitbreak_starting_mob,tag=!limitbreak_continue_mob,limit=1,sort=nearest,distance=..3] 3 player_attack by @p
execute as @a[scores={revenant_head_grab_dur=60}] at @s run damage @e[type=#enemy_mobs_only,tag=!limitbreak_starting_mob,tag=!limitbreak_continue_mob,limit=1,sort=nearest,distance=..3] 3 player_attack by @p
execute as @a[scores={revenant_head_grab_dur=40}] at @s run damage @e[type=#enemy_mobs_only,tag=!limitbreak_starting_mob,tag=!limitbreak_continue_mob,limit=1,sort=nearest,distance=..3] 3 player_attack by @p
execute as @a[scores={revenant_head_grab_dur=20}] at @s run damage @e[type=#enemy_mobs_only,tag=!limitbreak_starting_mob,tag=!limitbreak_continue_mob,limit=1,sort=nearest,distance=..3] 3 player_attack by @p
execute as @a[scores={revenant_head_grab_dur=1}] at @s run damage @e[type=#enemy_mobs_only,tag=!limitbreak_starting_mob,tag=!limitbreak_continue_mob,limit=1,sort=nearest,distance=..3] 3 player_attack by @p
scoreboard players remove @a[scores={revenant_head_grab_dur=1..}] revenant_head_grab_dur 1