Skip to content

playerHealthOrArmourDecreased

Tells your gamemode when a player’s game reports less health or armour than before. It’s what their game says happened, not a confirmed hit.

Renamed in 0.28 from damageObserved; see renamed names.

server.on("playerHealthOrArmourDecreased", ({ player, healthChange, armourChange, provenance, attacker, weapon }) => void)
Name Type Description
player PlayerSnapshot The player.
healthChange { before: number; after: number } | null The change in health, or null if health didn’t change.
armourChange { before: number; after: number } | null The change in armour, or null.
provenance "client-state" Where the observation comes from: the player’s own state reports.
attacker null Always null for now.
weapon null Always null for now.
gamemodes/my-mode.ts
import { server } from "nativemp";
server.on("playerHealthOrArmourDecreased", ({ player, healthChange }) => {
if (healthChange) server.log(`${player.name} lost ${healthChange.before - healthChange.after} health`);
});