Skip to content

ComponentOptions

Type

ComponentOptions configures replication scope, persistence, singleton storage, custom signals, relationship behavior, and editor hints on World.DefineComponent.

Scope

Field
Scope: ("Replicated" | "Server" | "Client")?

Scope sets where component data lives and replicates: "Replicated" saves on the server and replicates to clients, "Server" stays on the server, and "Client" stays local to each client.

Saved

Field
Saved: boolean?

Saved controls whether instances of the component serialize into the place file.

Singleton

Field
Singleton: boolean?

Singleton stores one world-wide instance of the component accessed through World instead of per-entity attachment.

Signals

Field
Signals: { [string]: { any } }?

Signals maps signal names to ordered arrays of Field.Arg descriptors, creating a DeclaredSignal member on the returned component handle for each entry.

PlayerList

Field
PlayerList: (boolean | { Label: string?, Column: number?, Sort: ("Ascending" | "Descending")?, Hidden: boolean?, [string]: never })?

PlayerList displays a numeric or string component field as a column in the player list, accepting true or a table with Label, Column, Sort, and Hidden.

Exclusive

Field
Exclusive: boolean?

Exclusive restricts a relationship component so each source entity holds at most one target at a time.

OnDeleteTarget

Field
OnDeleteTarget: ("Remove" | "Delete")?

OnDeleteTarget controls what happens when a relationship target is destroyed: "Remove" detaches the pair and "Delete" destroys the source entity as well.

Hints

Field
Hints: { [string]: FieldHint }?

Hints maps field names to editor metadata tables (Min, Max, Step, Tooltip).