Skip to content

API reference / @jsprismarine/prismarine / command/function/schedule / FunctionSchedule

Class: FunctionSchedule ​

Defined in: packages/prismarine/src/command/function/schedule.ts:25

Pending /schedule calls, ordered by when they come due.

Constructors ​

Constructor ​

new FunctionSchedule(): FunctionSchedule

Returns ​

FunctionSchedule

Accessors ​

size ​

Get Signature ​

get size(): number

Defined in: packages/prismarine/src/command/function/schedule.ts:32

How many calls are waiting.

Returns ​

number

Methods ​

add() ​

add(reference, delayTicks, mode): void

Defined in: packages/prismarine/src/command/function/schedule.ts:50

Queues a call.

Parameters ​

reference ​

string

delayTicks ​

number

How many ticks from now, as /schedule counts them. Zero means the next tick, because a schedule is never run inside the tick that made it.

mode ​

ScheduleMode

replace drops whatever was already pending under the same reference; append leaves it.

Returns ​

void


advance() ​

advance(): readonly string[]

Defined in: packages/prismarine/src/command/function/schedule.ts:84

Advances the clock one tick and takes everything that has come due.

Taken rather than run here. The queue decides when a call comes due and the runtime runs it. Entries come out in the order they were due, and a call one of them schedules lands after the ones already out.

Returns ​

readonly string[]

The references to run, in order.


clear() ​

clear(reference): number

Defined in: packages/prismarine/src/command/function/schedule.ts:65

Drops every pending call of one reference.

Parameters ​

reference ​

string

Returns ​

number

How many were dropped.


references() ​

references(): readonly string[]

Defined in: packages/prismarine/src/command/function/schedule.ts:37

Every pending reference, in the order the calls come due.

Returns ​

readonly string[]