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.
Signature
Section titled “Signature”interactions.listAll(): readonly Interaction[]Parameters
Section titled “Parameters”None.
Returns
Section titled “Returns”An array of Interaction, in no particular order. It is a copy: it does not change as uses
start and end.
Example
Section titled “Example”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`);});Related
Section titled “Related”interactions.getById: one useinteractions.stop: end a useinteractionStarted: a use began