execute as @a run attribute @s minecraft:gravity base set 0.1
# execute as @a run function main:mechanics/knockback_stop
#store coordinates
execute store result score .x_player mechanics run data get entity @s Pos[0] 1000
execute store result score .y_player mechanics run data get entity @s Pos[1] 1000
execute store result score .z_player mechanics run data get entity @s Pos[2] 1000

#determine the coordinates of the new pos
$execute store result score .x_knockback mechanics run data get entity @n[type=marker,tag=$(marker)] Pos[0] 1000
$execute store result score .z_knockback mechanics run data get entity @n[type=marker,tag=$(marker)] Pos[2] 1000
$execute store result score .y_knockback mechanics run data get entity @n[type=marker,tag=$(marker)] Pos[1] 1000

#determine the vector
scoreboard players operation .x_knockback mechanics -= .x_player mechanics
scoreboard players operation .y_knockback mechanics -= .y_player mechanics
scoreboard players operation .z_knockback mechanics -= .z_player mechanics

#apply arch calculations
scoreboard players operation .x_knockback mechanics *= .1785 number
scoreboard players operation .x_knockback mechanics /= .1000 number
scoreboard players operation .z_knockback mechanics *= .1785 number
scoreboard players operation .z_knockback mechanics /= .1000 number
scoreboard players operation .y_knockback mechanics *= .3 number
scoreboard players add .y_knockback mechanics 9000
#store
$execute store result storage mechanics knockback.x int $(strength) run scoreboard players get .x_knockback mechanics
$execute store result storage mechanics knockback.y int $(strength) run scoreboard players get .y_knockback mechanics
$execute store result storage mechanics knockback.z int $(strength) run scoreboard players get .z_knockback mechanics

function main:mechanics/knockback_xyz with storage mechanics knockback

$kill @e[type=marker,tag=$(marker)]