Quickly moving player horizontally
I'm trying to move the player through a tube with high speed. This works well vertically using levitation level 127 for going up, and just falling for going down. However, moving horizontally seems to be troublesome. I tried the tp command with relative coordinates:
execute as @e[type=minecraft:armor_stand,distance=..10] at @s run tp ~1 ~ ~
execute as @e[type=minecraft:armor_stand,distance=..10] at @s run tp @p[distance=..10] @s
(I am teleporting an armor stand relatively and then the player to the armor stand. This is so I can destroy the armor stand to stop the effect. When teleporting the player directly it becomes impossible to reach the command block)
In a repeating command block, this moves the player at 20 blocks per second. However, the movement is not smooth at all, one feels the teleportation effect constantly because there is no interpolation. Is there a way to avoid this and have the player move smoothly horizontally?
Minecraft version is 1.15.2.
The interpolation was intentionally removed for teleportation to fix bugs like https://bugs.mojang.com/browse/MC-4686.
There is no direct way to set player momentum (for example you can't just write to the Motion
tag). The best you can do is probably to summon a lot of invisible and unmoving entities in the direction you want to move the player away from and then keep teleporting them behind the player. That way the player still slightly slows down before accelerating again, but at 20 times per second, that shouldn't be very noticeable.
THe main problem with this method is that it depends a lot on server and connection lag. If those are bad, the movement will be extremely irregular. And it might also introduce its own server and client lag, simply because of having many colliding entities in one spot.