Skip to content
FMFallout Multiplayer Scripting APIScripting guides and API
Runtime classServer APIGenerated

WorkshopItem

Defined in: server/api.d.ts:2993

An object built in a settlement, by a player or a script, linked to a workbench the data files place. It lasts the whole session, whoever built it, until a player scraps or stores it or a script destroys it. Setting position or angle moves it for everyone.

new WorkshopItem(id): WorkshopItem

Defined in: server/api.d.ts:2998

Wraps an existing built object with this ID; it builds nothing. See WorkshopItem.place.

number

Network entity identifier.

WorkshopItem

Entity.constructor

destroy(): boolean

Defined in: server/api.d.ts:3019

Takes the object out of the settlement for everyone; nobody gets its components back.

boolean

True when it was there to take.


getSpace(): PlayerSpace | null

Defined in: server/api.d.ts:3031

Where the object stands.

PlayerSpace | null

The worldspace or interior cell, or null once it is gone.


setVirtualWorld(world): void

Defined in: server/api.d.ts:4292

Moves this entity into another virtual world.

number

Virtual-world identifier used to partition replication and visibility.

void

Entity.setVirtualWorld


setVisibleTo(player): void

Defined in: server/api.d.ts:4298

Restricts replication of this entity to one owning connection while preserving normal range and visibility checks.

Entity | null

Player-owned entity whose connection should exclusively receive this entity, or null to clear the restriction.

void

Entity.setVisibleTo


toString(): string

Defined in: server/api.d.ts:3025

Formats this handle for logging.

string

The object’s network ID, form and workbench.

Entity.toString


static all(workbench?): WorkshopItem[]

Defined in: server/api.d.ts:3050

Every object built this session.

string | number

Only the objects of this workbench.

WorkshopItem[]

One handle per object.


static place(form, workbench, position, space, angle?, wire?): WorkshopItem | null

Defined in: server/api.d.ts:3043

Builds an object for everyone, as if a player had at that workbench. Nothing is checked: not the recipe, its cost nor the buildable area. A wire is laid out between its two ends on every client once both are loaded, and linked into their power grid.

string | number

The base object to build.

string | number

The workbench reference it belongs to, placed by the data files.

Vector3

Where it stands.

The worldspace, or the interior cell: exactly one of the two.

string | number

string | number

Vector3

Its rotation, radians.

For a wire (the game’s workshop spline), the two objects it joins: a built object, or a placed reference’s form ID, each with the connect point the wire takes on it (0 by default).

string | number | WorkshopItem

number

string | number | WorkshopItem

number

WorkshopItem | null

The object, or null when it could not be created.

angle: Vector3

Defined in: server/api.d.ts:3013

Its rotation, radians, as the game stores it. Assigning turns it for everyone.


readonly form: number

Defined in: server/api.d.ts:3003

The base object’s form ID; 0 once it is gone.


readonly id: number

Defined in: server/api.d.ts:4260

Immutable network entity identifier.

Entity.id


position: Vector3

Defined in: server/api.d.ts:4270

Authoritative world-space position; assignment forces replicated state.

Entity.position


rotation: Vector3 | Quaternion

Defined in: server/api.d.ts:4275

Authoritative rotation; reads return a quaternion and assignments accept a quaternion or Euler angles in degrees.

Entity.rotation


readonly state: StateBag

Defined in: server/api.d.ts:4280

Arbitrary key/value state carried by this entity. The server writes it and every client that can see the entity receives it; see StateBag.

Entity.state


readonly virtualWorld: number

Defined in: server/api.d.ts:4265

Current virtual-world identifier.

Entity.virtualWorld


readonly workbench: number

Defined in: server/api.d.ts:3008

The workbench reference it belongs to; 0 once it is gone.