Skip to content

objects.listAll

Lists your gamemode’s objects. The server removes them when the gamemode stops or reloads.

Renamed in 0.28 from objects.all; see renamed names.

objects.listAll(): readonly ScriptObject[]

None.

An array of ScriptObject. It is a copy: it does not change as objects come and go.

gamemodes/my-mode.ts
import { objects, server } from "nativemp";
for (const object of objects.listAll()) {
server.log(`${object.id}: model ${object.model} at ${object.position.join(", ")}`);
}