# Damage
scoreboard players add @s damage 400

#get stone pos
execute store result score x motion_calc run data get entity @e[type=marker,tag=stone_b,tag=ch2_olinked,limit=1] Pos[0] 1000
execute store result score y motion_calc run data get entity @e[type=marker,tag=stone_b,tag=ch2_olinked,limit=1] Pos[1] 1000
execute store result score z motion_calc run data get entity @e[type=marker,tag=stone_b,tag=ch2_olinked,limit=1] Pos[2] 1000

execute store result score dx motion_calc run data get entity @e[type=#as,tag=stone,tag=ch2_olinked,limit=1] Pos[0] 1000
execute store result score dy motion_calc run data get entity @e[type=#as,tag=stone,tag=ch2_olinked,limit=1] Pos[1] 1000
execute store result score dz motion_calc run data get entity @e[type=#as,tag=stone,tag=ch2_olinked,limit=1] Pos[2] 1000

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

#give motion
execute store result entity @s Motion[0] double 0.0017 run scoreboard players get dx motion_calc
execute store result entity @s Motion[1] double 0.0017 run scoreboard players get dy motion_calc
execute store result entity @s Motion[2] double 0.0017 run scoreboard players get dz motion_calc
