Question about vectors (player velocity) and Spigot API

44 Views Asked by At

I can’t understand how I can push the player back, left and right, I only understood how to push the player to the side where he is looking.

I tried to use ChatGPT but it produced code that doesn't work as expected.

Please tell me!

1

There are 1 best solutions below

0
Quitrin Dev On

You can do it with player.setVelocity(new Vector(x, y, z));. To throw player up, you can do player.setVelocity(new Vector(0, 1, 0)); etc.