scoreboard players set #timer ghost_vars 0
execute as @e[type=minecraft:mannequin,tag=ghost_entity] at @s facing entity @p[sort=nearest,limit=1] eyes run teleport @s ~ ~ ~ ~ 0
effect clear @e[type=minecraft:mannequin,tag=ghost_entity] minecraft:invisibility
effect give @a minecraft:darkness 3 0 true
execute as @a at @s run playsound minecraft:ambient.soul_sand_valley.mood ambient @s ~ ~ ~ 1 1
execute as @a at @s run playsound minecraft:ambient.warped_forest.mood ambient @s ~ ~ ~ 1 1


schedule function ghosts:hide_ghost 1s replace