#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#
#    This function has been created by Skilendarz Group.
#             https://skilendarz.com
#
#      GIVE MAP MAKERS THE CREDIT THEY DESERVE!
#             COPYING IS PROHIBITED!
#
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

scoreboard players operation @e[tag=pumpkin_win_effect] id2 = @s id
execute as @e[tag=pumpkin_win_effect] if score @s id = @s id2 run tag @s add this_p

#Position
scoreboard players add @e[tag=this_p] pos_x 5
tp @e[tag=this_p] ~ ~ ~
execute as @e[tag=this_p] store result entity @s Rotation[0] float 1 run scoreboard players get @s pos_x
execute as @e[tag=this_p] at @s run tp @s ^ ^ ^-2.5

#Rotation
scoreboard players remove @e[tag=this_p] pos_y 10
execute as @e[tag=this_p] store result entity @s Rotation[0] float 1 run scoreboard players get @s pos_y

#Height
scoreboard players operation $cos main = @e[tag=this_p,limit=1] pos_y
function f:lobby/options/cos/cos

execute as @e[tag=this_p] store result score @s pos_z run data get entity @s Pos[1] 200
scoreboard players operation @e[tag=this_p] pos_z += $cos main
execute as @e[tag=this_p] store result entity @s Pos[1] double 0.005 run scoreboard players get @s pos_z

execute at @e[tag=this_p] run particle minecraft:witch ~ ~1.5 ~

tag @e[tag=this_p] remove this_p