Alpha: this compiler is under active development and updates will break your projects. Not recommended for real use yet.
Skip to content

spool / PlayerMotion

Interface: PlayerMotion โ€‹

Defined in: plugins/player_motion/index.ts:36

Sets a player's velocity. Get it from dp.playerMotion().

Properties โ€‹

launchGlobalXyz โ€‹

readonly launchGlobalXyz: FunctionRef

Defined in: plugins/player_motion/index.ts:66

launch_global_xyz - the raw function, to ctx.call yourself after setting launchInput.


launchInput โ€‹

readonly launchInput: object

Defined in: plugins/player_motion/index.ts:72

The $x/$y/$z player_motion.api.launch input scores, in fixed-point (10000 = 1 block/tick). Prefer launchLocal / launchGlobal, which convert for you.

x โ€‹

readonly x: Score

y โ€‹

readonly y: Score

z โ€‹

readonly z: Score


launchLocalXyz โ€‹

readonly launchLocalXyz: FunctionRef

Defined in: plugins/player_motion/index.ts:64

launch_local_xyz - the raw function, to ctx.call yourself after setting launchInput.


launchVelocity โ€‹

readonly launchVelocity: ScoreVec3

Defined in: plugins/player_motion/index.ts:78

The launchInput scores in blocks/tick, for math and set with real values.

Methods โ€‹

applyGlobal() โ€‹

applyGlobal(ctx, velocity?): void

Defined in: plugins/player_motion/index.ts:60

Like launchGlobal, but sustained per tick. See applyLocal.

Past +/-12398 it fails before clearing the sustain flag, which can leak into the next launch. Not an issue at per-tick speeds.

Parameters โ€‹

ctx โ€‹

FunctionContext

velocity? โ€‹

GlobalVelocity

Returns โ€‹

void


applyLocal() โ€‹

applyLocal(ctx, velocity?): void

Defined in: plugins/player_motion/index.ts:52

Like launchLocal, but for a per-tick sustained push (thrust, grapple, swing).

Skips the gamemode swap, so the player must already be moving; start from standstill with launchLocal. Omit velocity to use what's already in launchInput.

Parameters โ€‹

ctx โ€‹

FunctionContext

velocity? โ€‹

LocalVelocity

Returns โ€‹

void


launchGlobal() โ€‹

launchGlobal(ctx, velocity): void

Defined in: plugins/player_motion/index.ts:43

Launches the executing player along world axes. Run at the player. Values beyond +/-12398 per axis aren't supported and return fail.

Parameters โ€‹

ctx โ€‹

FunctionContext

velocity โ€‹

GlobalVelocity

Returns โ€‹

void


launchLocal() โ€‹

launchLocal(ctx, velocity): void

Defined in: plugins/player_motion/index.ts:38

Launches the executing player relative to their facing. Run as and at the player.

Parameters โ€‹

ctx โ€‹

FunctionContext

velocity โ€‹

LocalVelocity

Returns โ€‹

void

Released under the MIT License ยท Credits
These docs were written with AI; the layout and every page have been reviewed by a human.