Entity spawned on the same tick won't instantly move when changing Motion data
1.21.6!
I'm just trying to make a throwable item (With gravity) so i just made an advancement for when i consume the item, and run a throw function. In the function i then summon an invisible armor stand with a custom model on it head. I then use scoreboards to calculate how the armor stand should move, based on where the players looking. I then use execute store and scoreboard get to store the results of the calculation into the armor stands Motion nbt.
My problem is that it works, but the armor stand doesn't instantly start moving, and just sits still for a sec before the Motion seems to get applied properly.
If anybody knows how to fix it, it would be appreciated 🙂
Motion calc code if anybodys wondering:
execute store result score @s sprite.dash.dx1 run data get entity @s Pos[0] 1000 execute store result score @s sprite.dash.dy1 run data get entity @s Pos[1] 1000 execute store result score @s sprite.dash.dz1 run data get entity @s Pos[2] 1000
tp @s ^ ^ ^0.1
execute store result score @s sprite.dash.dx2 run data get entity @s Pos[0] 1000 execute store result score @s sprite.dash.dy2 run data get entity @s Pos[1] 1000 execute store result score @s sprite.dash.dz2 run data get entity @s Pos[2] 1000
scoreboard players operation @s sprite.dash.dx2 -= @s sprite.dash.dx1 execute store result entity @s Motion[0] double 0.005 run scoreboard players get @s sprite.dash.dx2
scoreboard players operation @s sprite.dash.dy2 -= @s sprite.dash.dy1 execute store result entity @s Motion[1] double 0.005 run scoreboard players get @s sprite.dash.dy2
scoreboard players operation @s sprite.dash.dz2 -= @s sprite.dash.dz1 execute store result entity @s Motion[2] double 0.005 run scoreboard players get @s sprite.dash.dz2