# Damage
scoreboard players add @s damage 200

#get shield pos
execute store result score x motion_calc run data get entity @e[tag=st_stone,tag=ch1_olinked,sort=nearest,limit=1] Pos[0] 1000
execute store result score y motion_calc run data get entity @e[tag=st_stone,tag=ch1_olinked,sort=nearest,limit=1] Pos[1] 1000
execute store result score z motion_calc run data get entity @e[tag=st_stone,tag=ch1_olinked,sort=nearest,limit=1] Pos[2] 1000

execute store result score dx motion_calc run data get entity @e[tag=st_point,tag=ch1_olinked,sort=nearest,limit=1] Pos[0] 1000
execute store result score dy motion_calc run data get entity @e[tag=st_point,tag=ch1_olinked,sort=nearest,limit=1] Pos[1] 1000
execute store result score dz motion_calc run data get entity @e[tag=st_point,tag=ch1_olinked,sort=nearest,limit=1] Pos[2] 1000

#calc
scoreboard players operation x motion_calc -= dx motion_calc
scoreboard players operation y motion_calc -= dy motion_calc
scoreboard players operation z motion_calc -= dz motion_calc

#give motion
execute store result entity @s Motion[0] double 0.0016 run scoreboard players get x motion_calc
execute store result entity @s Motion[1] double 0.0016 run scoreboard players get y motion_calc
execute store result entity @s Motion[2] double 0.0016 run scoreboard players get z motion_calc
