# Create marker
summon cod ^ ^ ^.5 {Tags:["slime_bounce","attack","EB","init","unspellable","mrcd_bullet","no_coin_drop","nonlocking"],NoGravity:1b,Silent:1b,Invulnerable:1b,NoAI:1b,ActiveEffects:[{Id:14b,Amplifier:1b,Duration:1000000,ShowParticles:0b}],Passengers:[{id:"falling_block",BlockState:{Name:"slime_block"},NoGravity:1b,Time:1,DropItem:0b,Tags:["unspellable","sb_obj"]}]}
scoreboard players set @e[tag=slime_bounce,tag=init,limit=1] countdown 100

# Save speed and direction
execute as @e[tag=slime_bounce,tag=init,limit=1] store result score @s mrcd_x0 run data get entity @s Pos[0] 1000
execute as @e[tag=slime_bounce,tag=init,limit=1] store result score @s mrcd_y0 run data get entity @s Pos[1] 1000
execute as @e[tag=slime_bounce,tag=init,limit=1] store result score @s mrcd_z0 run data get entity @s Pos[2] 1000

execute store result score #var0 mrcd_system run data get entity @s Pos[0] 1000
execute store result score #var1 mrcd_system run data get entity @s Pos[1] 1000
execute store result score #var2 mrcd_system run data get entity @s Pos[2] 1000

scoreboard players operation @e[tag=slime_bounce,tag=init,limit=1] mrcd_x0 -= #var0 mrcd_system
scoreboard players operation @e[tag=slime_bounce,tag=init,limit=1] mrcd_y0 -= #var1 mrcd_system
scoreboard players operation @e[tag=slime_bounce,tag=init,limit=1] mrcd_z0 -= #var2 mrcd_system

execute at @s anchored eyes positioned ^ ^ ^1 run tp @e[tag=slime_bounce,tag=init,limit=1] ~ ~ ~ ~ ~

# Clear tag
tag @e[tag=slime_bounce,tag=init,limit=1] remove init
