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

Item

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

A loose item in the world: one a player dropped or a script spawned. Picking it up destroys it, after which the handle reads nothing. Setting position moves it for everyone.

new Item(id): Item

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

Wraps an existing item with this ID; it spawns nothing. See Item.spawn.

number

Network entity identifier.

Item

Entity.constructor

destroy(): boolean

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

Takes the item out of the world for everyone.

boolean

True when it was there to take.


getSpace(): PlayerSpace | null

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

Where the item lies.

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:1888

Formats this handle for logging.

string

The item’s network ID, form and count.

Entity.toString


static all(): Item[]

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

Every loose item in the world.

Item[]

One handle per item.


static spawn(form, count, position, space, angle?): Item | null

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

Puts a loose item in the world, which any player can pick up. It does not fall: it stays where it is put.

string | number

The base object.

number

How many, 1 to 1000000.

Vector3

Where it lies.

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

string | number

string | number

Vector3

Its rotation, radians.

Item | null

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

readonly count: number

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

How many the stack holds; 0 once it is gone.


readonly form: number

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

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