Skip to content

textLabels.update

Changes the settings you give and keeps the rest. Players who see the text label see the change at once. players: null makes it everyone’s again.

Renamed in 0.28 from labels.update; see renamed names.

textLabels.update(id: number, changes: Partial<TextLabelSettings>): Promise<ActionResult>
Name Type Description
id number The ID from textLabels.create.
changes Partial<TextLabelSettings> Any of its settings; see textLabels.create.

A promise of an ActionResult: applied, or rejected with the codes of textLabels.create, or marker-not-found for an ID that is not one of your text labels. A rejected update changes nothing.

gamemodes/my-mode.ts
import { textLabels } from "nativemp";
for (const marker of textLabels.listAll()) await textLabels.update(marker.id, { text: "Closed", colorRgba: 0xFF0000FF });