Velocity Command
The velocity command allows you to modify the velocity of players. This is already possible for non-player entities in vanilla, but the velocity command allows more flexibility regarding the direction and magnitude of the velocity applied.
velocity <targets> (set|add) <velocity>| Argument | Type | Description |
|---|---|---|
targets | target selector | The entities to modify the velocity of. |
velocity | vector 3 | The velocity to set/add to the entity. |
How Velocity is Calculated
Section titled “How Velocity is Calculated”The velocity argument supports absolute values as well as tilde and caret notations.
However, they will be calculated as a multiplier on the the executor’s current velocity, not the command’s position.
For example, using tilde notation you could set Player1’s velocity to be the same as Player2’s, with the following command:
execute as Player1 run velocity set Player2 ~1 ~1 ~1Caret notation can be used to appy velocity in the direction the executor is currently looking, for example:
velocity add @s ^ ^ ^1