Skip to content

players.setArmour

Sets a player’s armour.

players.setArmour(player: PlayerTarget, armour: number): Promise<ActionResult>
Name Type Description
player PlayerTarget The player, or their ID.
armour number The new armour, 0 to 1000. A normal maximum is 100.

A promise of an ActionResult: applied once the player’s game has carried it out, rejected with a code, or timeout after five seconds without an answer.

gamemodes/my-mode.ts
import { commands, players } from "nativemp";
commands.register("armour", async (player) => {
await players.setArmour(player, 100);
});

A captured Player keeps this effect bound to its connection across awaits; see Async handlers.