Skip to content

Translation notice

This page was translated with machine translation and may contain inaccuracies. If you can help improve it, please open an issue or submit a pull request.

Cover

Fast Motion

Cree who can’t draw

Cree who can’t draw

This is a data pack that allows you to more easily assign speed to the player. It supports Minecraft Java version 1.21.11 and above. Click to download data pack

Disadvantages of the data pack

There is an error in the speed assigned, and the error value is scattered within -0.001~0.001. Limited by the author's ability, this data pack is not optimized and has poor performance.

usage

We can give the player speed by performing the following two functions.

mcfunction
function motion:apply_arguments
function motion:apply_scoreboard

When the data pack executes these two functions, it will give the executor the speed of pointing in the three directions of right left, right up, and right in front of the execution direction (the executor must be a player).

Therefore, we need to use/functionWhen the command executes these two functions, it passes in two sets of parameters: execution direction and velocity in each direction.

Execution direction

The execution direction is passed directly through the command context.

Example: Give a player the speed to point directly left, directly up, and directly in front of him.

mcfunction
execute as @r at @s run function motion:apply_arguments {x:100,y:100,z:100}

Give a player the speed of pointing in the three directions of due east, due up, and due south of the world.

mcfunction
execute as @r rotated 0 0 run function motion:apply_arguments {x:100,y:100,z:100}

Speed ​​in each direction

The unit of speed is frame per tick, and its input has the following regulations:

  • The range is -10000~10000
  • Must be an integer
  • Must be 1000 times the actual output speed

The passing method needs to be determined based on the difference between the two functions.

motion:apply_arguments

For motion:apply_argumentsfunction, we need to use/functionThe command passes in a composite tag to pass in the speed in each direction. The content of the composite tag is as follows:

compound *
  • int * x: points to the speed of execution towards the direct left.
  • int * y: points to the speed of the execution direction directly upward.
  • int * z: points to the speed of execution moving forward.

Notice

The speed in three directions cannot be omitted. If you do not need to give the axis speed, please set its size to 0.

Example: Give a player a speed of 0.1 squares per tick pointing directly below the world.

mcfunction
execute as @r rotated 0 0 run function motion:apply_arguments {x:0,y:-100,z:0}

motion:apply_scoreboard

For motion:apply_scoreboardfunction, we need to pass in the speed in each direction by setting the scores of the following three scoreboards of the executor:

motion.x
motion.y
motion.z

They respectively represent the speeds pointing directly to the left, directly up, and directly forward of the execution direction.

hint

The scoreboard without a score set will automatically be regarded as 0 points, that is, the speed size is 0.

Example: Give each player a speed of 5.085 squares per tick pointing directly below the world.

mcfunction
scoreboard players set @a motion.z -5085
execute as @a rotated 0 0 run function motion:apply_scoreboard

Modify each player's Motiontag roughly to [0.9d,-4.0d,3.0d].

mcfunction
scoreboard players set @a motion.x 900
scoreboard players set @a motion.y -4000
scoreboard players set @a motion.z 3000
execute as @a rotated 0 0 run function motion:apply_scoreboard

Finally, click here Watch a more detailed video explanation

Powered by VitePress and GitHub Pages