Skip to content

API reference / @jsprismarine/prismarine / world/changelog/TickHeader

world/changelog/TickHeader ​

Type Aliases ​

Plain ​

Plain<Shape> = Shape

Defined in: packages/prismarine/src/world/changelog/TickHeader.ts:4

A shape checked to be plain data where it is declared.

Type Parameters ​

Shape ​

Shape extends PlainRecord


TickHeader ​

TickHeader = Plain<{ gameRules: readonly (readonly [string, readonly [boolean | number, boolean]])[]; pendingChunkLoads: readonly (readonly [number, string])[]; pendingLighting: Plain<{ deferred: number; queued: number; }>; randomTickState: number; settlingChunks: readonly number[]; tick: number; weather: Plain<{ clearWeatherTime: number; raining: boolean; rainTime: number; thundering: boolean; thunderTime: number; }>; }>

Defined in: packages/prismarine/src/world/changelog/TickHeader.ts:24

What a world's own clocks and the work it has in flight were as a tick sealed: the part of the replay digest that no entry of the change log carries (ADR 0012).

Each of these moves every tick whether or not anything was written, so an entry for each would break the rule that an idle world appends nothing. The sealed tick carries them once instead, which is how a snapshot plus the log reaches a later tick's digest without running the tick.

  • The level clock, the weather cycle and the random tick generator advance on every tick.
  • The game rules belong to the level, which every world of it shares, so no one world's log owns a change to them.
  • The light queue is work derived from block writes, and only a tick drains it.
  • The chunk loads in flight are requests whose completions arrive as inputs (ADR 0009).
  • The chunks still settling decide whether what the world destroys drops, and a chunk stops settling on a tick that writes nothing.