Skip to content

interactions.listAll

Lists the uses going on now: players at vending machines, food carts, gym machines and your interactive objects. A use your gamemode has not answered yet, or refused, is not in it. After your gamemode reloads, the uses still going are listed.

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

interactions.listAll(): readonly Interaction[]

None.

An array of Interaction, in no particular order. It is a copy: it does not change as uses start and end.

gamemodes/my-mode.ts
import { commands, interactions, server } from "nativemp";
commands.register("gym", () => {
const gym = interactions.listAll().filter((use) => use.interactionKind.startsWith("gym-"));
server.log(`${gym.length} players are working out`);
});