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

#Predict pos
execute store result score @s pos_x run data get entity @s Pos[0] 10
execute store result score @s pos_y run data get entity @s Pos[1] 10
execute store result score @s pos_z run data get entity @s Pos[2] 10

execute store result score @s hitbox_x run data get entity @e[tag=this,limit=1] Motion[0] 10
execute store result score @s hitbox_y run data get entity @e[tag=this,limit=1] Motion[1] 10
execute store result score @s hitbox_z run data get entity @e[tag=this,limit=1] Motion[2] 10

scoreboard players operation @s pos_x += @s hitbox_x
scoreboard players operation @s pos_y += @s hitbox_y
scoreboard players operation @s pos_z += @s hitbox_z

execute store result entity @s Pos[0] double 0.1 run scoreboard players get @s pos_x
execute store result entity @s Pos[1] double 0.1 run scoreboard players get @s pos_y
execute store result entity @s Pos[2] double 0.1 run scoreboard players get @s pos_z