Skip to content

API reference / @jsprismarine/engine-systems / TickScheduler

Class: TickScheduler ​

Defined in: engine-systems/src/scheduler.ts:223

The block tick list and the fluid tick list, which ServerLevel.tick runs in that order: blockTicks.tick before fluidTicks.tick, both before block events and entities.

Constructors ​

Constructor ​

new TickScheduler(): TickScheduler

Returns ​

TickScheduler

Methods ​

list() ​

list(kind): TickList

Defined in: engine-systems/src/scheduler.ts:227

One of the two tick lists.

Parameters ​

kind ​

TickKind

Returns ​

TickList


snapshot() ​

snapshot(): object

Defined in: engine-systems/src/scheduler.ts:232

Copies pending block and fluid ticks without changing their live drain order.

Returns ​

object

block ​

readonly block: readonly ScheduledTick[]

fluid ​

readonly fluid: readonly ScheduledTick[]


tick() ​

tick(currentTick, run, maxTicks?, deadline?): number

Defined in: engine-systems/src/scheduler.ts:246

Run one game tick: block ticks first, then fluid ticks, matching the order in ServerLevel.tick.

Parameters ​

currentTick ​

number

The game tick to run.

run ​

(kind, tick) => void

Called with each due tick and the list it came from.

maxTicks? ​

number = MAX_SCHEDULED_TICKS_PER_TICK

The per-list budget, defaulting to Java's 65536.

deadline? ​

number = Number.POSITIVE_INFINITY

A performance.now() time shared by both lists; see TickList.tick.

Returns ​

number

How many ticks ran across both lists.