0

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.

  • There should be interpolation. Do you have client lag? – Fabian Röling Mar 7 at 23:24
  • Are you trying to remake this? youtube.com/watch?v=UegvUSNvJ4U – Fabian Röling Mar 7 at 23:25
  • @FabianRöling I originally tried it on a SpigotMC server, but today I tested in singleplayer and there was still no interpolation. Also, I updated the question with the real commands I'm using. – Clashsoft Mar 8 at 21:43
  • @FabianRöling The SethBling video comes close but the downloadable data pack was somewhat obfuscated so not really helpful. – Clashsoft Mar 8 at 21:44
  • I don't think it's intentionally obfuscated, just very complex and probably partially auto-generated. – Fabian Röling Mar 9 at 5:20
1

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.