1 Internal Model
Victor Westerlund edited this page 2026-11-22 09:51:37 +01:00

Internal Model

Public functions use replay:. Functions under z_replay: and the contents of replay:runtime storage are internal implementation details.

Sample markers

Each sample marker has the tag replay.sample and a data compound containing:

Field Meaning
id, index Recording ID and zero-based sample index
t Tick offset from the start of the recording
x, y, z Full-precision position
yaw, pitch Look direction in degrees
dimension Dimension resource ID
pose Standing, crouching, swimming, fall-flying, or sleeping pose

Inspect a nearby sample, or the saved metadata:

/data get entity @n[type=minecraft:marker, tag=replay.sample] data
/data get storage replay:data recordings.r1

Persistent storage

replay:data stores each track under recordings.r<ID>, with its owner UUID, active flag, duration, playback generation, profile, skin_version, and ordered frames list. New tracks start with an empty profile and skin version zero. Older tracks without a profile use the default skin and need no data migration.

The catalog list indexes recording IDs and active flags for listing and bulk deletion without copying frame lists. Older worlds build this index automatically on reload, in bounded batches. Listing and delete_all report that the list is still loading until the upgrade finishes; recording and individual deletion remain available. Frames duplicate the marker payload so playback does not depend on sample chunks remaining loaded. Dimension changes, including custom dimensions, are captured at sample time and registered for playback scanning.

Mannequins and scoreboards

Mannequins have the tag replay.actor. Their cursors and clocks are independent entity scores. They are invulnerable, immovable, and unaffected by gravity. They use the default skin until a skin is selected with replay:edit/skin. Edited player names are dynamic profiles resolved by the client; ownership does not select a skin. Equipment, interactions, block changes, and exact limb animations are outside the recording format.

See Recording and Playback for timing, older sparse recordings, and what happens when players or chunks are absent.

mcfstd integration

The pack uses mcfstd's public var:, call:arg, and stdout: APIs for persistent ID allocation and catalog-upgrade progress. The replay_catalog_next, replay_catalog_end, and replay_catalog_batch integer variables live in _var while indexing and are removed when it finishes. An upgrade already in progress with the older counters restarts indexing safely on reload. Catalog writes use var: functions, while native score comparisons read these replay-owned entries directly to keep each indexing batch inexpensive.

Entity clocks and cursors use the pack's own rpl_* scoreboards for per-tick work. Recording generations and skin versions stay beside their recording in storage: playback reads them every tick, and deletion removes the whole record at once. Frames, profiles, UUIDs, and dimension lists also need NBT rather than integer variables. z_replay: functions and replay:runtime storage are internal.

Dimension traversal is shared by playback, marker cleanup, halt, delete_all, and skin editing. Native entity scores keep each player's and mannequin's timing independent; mcfstd variables provide global named integers rather than entity-local state.

Validation

The separate integration test datapack checks recording, timing, dimension transfers, management, editing, and uninstallation against Minecraft 1.21.9 and 26.3. Use disposable test worlds: management deletes all stored recordings, and uninstallation erases all replay state. The test README contains installation, execution, and lifecycle checks.