Skip to content

API Function replicate

github-actions[bot] edited this page Nov 24, 2026 · 1 revision

Function: replicate()

function replicate(def, options?): void;

Defined in: src/engine/net/replication.ts:65

Mark a data component as replicated. Both ends must call it the same way (it's part of the game's code, like the component itself).

export const Health = defineComponent("game.Health", { current: f32, max: f32 });
replicate(Health, { encoding: { current: { quantize: 0.1 } } });

Parameters

def

DataComponentDef

options?

DataReplication = {}

Returns

void

Clone this wiki locally