[API reference](https://jsprismarine.dev/api/index.md) / [@jsprismarine/prismarine](https://jsprismarine.dev/api/@jsprismarine/prismarine/index.md) / [command/function/schedule](https://jsprismarine.dev/api/@jsprismarine/prismarine/command/function/schedule/index.md) / FunctionSchedule

# Class: FunctionSchedule

Defined in: [packages/prismarine/src/command/function/schedule.ts:25](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/command/function/schedule.ts#L25)

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](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/command/function/schedule.ts#L32)

How many calls are waiting.

##### Returns

`number`

## Methods

### add()

> **add**(`reference`, `delayTicks`, `mode`): `void`

Defined in: [packages/prismarine/src/command/function/schedule.ts:50](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/command/function/schedule.ts#L50)

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`](https://jsprismarine.dev/api/@jsprismarine/prismarine/command/function/schedule/index.md#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](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/command/function/schedule.ts#L84)

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](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/command/function/schedule.ts#L65)

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](https://github.com/JSPrismarine/JSPrismarine/blob/e928b08f56694af6821b757ce6b196faebd3199c/packages/prismarine/src/command/function/schedule.ts#L37)

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

#### Returns

readonly `string`[]
