Skip to content

spool / Clip

Class: Clip

Defined in: plugins/clip/clip.ts:41

Constructors

Constructor

new Clip(dp, label, primary?): Clip

Defined in: plugins/clip/clip.ts:62

Parameters

dp

Datapack

label

string

primary?

DisplayValue

Returns

Clip

Methods

at()

at(tick, cb): this

Defined in: plugins/clip/clip.ts:154

Run cb's commands at absolute tick tick (sound, particle, title, anything).

Parameters

tick

number

cb

Emit

Returns

this


bake()

bake(): this

Defined in: plugins/clip/clip.ts:104

Force per-tick baked frames for the primary model.

Returns

this


forSeconds()

forSeconds(seconds): this

Defined in: plugins/clip/clip.ts:140

Run for this many seconds.

Parameters

seconds

number

Returns

this


loop()

loop(ctx): void

Defined in: plugins/clip/clip.ts:173

Start a continuous, tick-driven run (forever unless a duration was set).

Parameters

ctx

FunctionContext

Returns

void


markForCutscene()

markForCutscene(): void

Defined in: plugins/clip/clip.ts:194

Ensure the functions a Cutscene schedules get generated.

Returns

void


move()

move(delta): this

Defined in: plugins/clip/clip.ts:84

Translate the primary model by delta over the clip duration.

Parameters

delta

Vec3

Returns

this


nbt()

nbt(selector, path, keys): this

Defined in: plugins/clip/clip.ts:122

Animate an arbitrary NBT path on selector over keyframes (baked).

Parameters

selector

Selector

path

string

keys

readonly Keyframe<NbtValue>[]

Returns

this


over()

over(ticks): this

Defined in: plugins/clip/clip.ts:134

Run for this many ticks.

Parameters

ticks

number

Returns

this


play()

play(ctx, afterTicks?): void

Defined in: plugins/clip/clip.ts:163

Play the clip forward from a function body (afterTicks delays the start).

Parameters

ctx

FunctionContext

afterTicks?

number = 0

Returns

void


playLength()

playLength(): number

Defined in: plugins/clip/clip.ts:189

Tick count play would schedule (for a Cutscene to offset).

Returns

number


reverse()

reverse(ctx, afterTicks?): void

Defined in: plugins/clip/clip.ts:168

Play the clip backward (door close; spin wind-back).

Parameters

ctx

FunctionContext

afterTicks?

number = 0

Returns

void


rotateTo()

rotateTo(q): this

Defined in: plugins/clip/clip.ts:99

Set the primary model's orientation to q over the clip duration.

Parameters

q

Quat

Returns

this


scaleTo()

scaleTo(to): this

Defined in: plugins/clip/clip.ts:94

Scale the primary model to to over the clip duration.

Parameters

to

Vec3

Returns

this


scheduleInto()

scheduleInto(ctx, baseTick): void

Defined in: plugins/clip/clip.ts:203

Emit this clip's whole timeline into ctx, offset by baseTick - a Cutscene calls this from its master schedule. Smooth clips kick off their single native tween at the offset; frame clips fan their frames out.

Parameters

ctx

FunctionContext

baseTick

number

Returns

void


smooth()

smooth(): this

Defined in: plugins/clip/clip.ts:109

Force the native-interpolation path for the primary model.

Returns

this


snap()

snap(degrees?): this

Defined in: plugins/clip/clip.ts:148

Make a spin come to rest on a multiple of degrees (default 90 - never mid-tooth). Nudges the played duration so the resting frame lands on a snap angle. Pure-spin clips only; the spin speed must divide degrees evenly.

Parameters

degrees?

number = 90

Returns

this


spin()

spin(axis, degPerTick): this

Defined in: plugins/clip/clip.ts:89

Spin the primary model about axis at degPerTick (negative reverses).

Parameters

axis

Axis

degPerTick

number

Returns

this


start()

start(ctx, afterTicks?): void

Defined in: plugins/clip/clip.ts:178

Begin (or restart) a timed tick-driven run (afterTicks staggers it).

Parameters

ctx

FunctionContext

afterTicks?

number = 0

Returns

void


stop()

stop(ctx): void

Defined in: plugins/clip/clip.ts:183

Halt a tick-driven run.

Parameters

ctx

FunctionContext

Returns

void


tp()

tp(selector, keys): this

Defined in: plugins/clip/clip.ts:127

Teleport selector along a positional path over keyframes - camera/entity dolly.

Parameters

selector

Selector

keys

readonly Keyframe<Vec3>[]

Returns

this


track()

track(model): TransformTrack

Defined in: plugins/clip/clip.ts:116

Add another display-model transform track (chain .move/.spin/… on it).

Parameters

model

DisplayValue

Returns

TransformTrack

Released under the MIT License · Credits