Skip to content
KCKingdoms Connected Scripting APIScripting guides and API
Data shapeServer APIGenerated

PlayerHit

Defined in: server/api.d.ts:1319

A player or NPC blow, as playerHit shows it before the referee rules. damage is what the blow will take and modifiers scale how the server works it out; a handler may change either. Every other field describes what happened and is read-only in effect.

armor: DamagePasses

Defined in: server/api.d.ts:1348

The victim’s armour in each pass where the blow landed, before modifiers.


attack: DamagePasses

Defined in: server/api.d.ts:1343

The attacker’s attack in each pass, after the swing’s own strength and before modifiers.


blockBroken: boolean

Defined in: server/api.d.ts:1398

The victim’s block gave way under it.


blockDefense: number

Defined in: server/api.d.ts:1353

What the victim’s block put up, or 0 when nothing blocked it.


blocked: boolean

Defined in: server/api.d.ts:1388

The victim’s block caught it.


bodyPart: "head" | "torso" | "leftArm" | "rightArm" | "leftLeg" | "rightLeg" | null

Defined in: server/api.d.ts:1373

The limb it landed on, or null for none in particular.


bodyPartCoefficient: number

Defined in: server/api.d.ts:1358

How much the place it landed multiplies the damage by: 1.5 for the head, 1 for the torso, 0.7 for a limb.


damage: number

Defined in: server/api.d.ts:1323

Health the blow takes. For melee between players the server works it out itself, the way the game does, from the attacker’s weapon and its wear, both players’ strength and skills, the armour the victim wears where it landed, the block and the perks and buffs it can vouch for; for NPC melee or an arrow it is what the victim’s own game worked out. Set it and it stands as set: modifiers are then ignored. Never negative.


engineDamage: number

Defined in: server/api.d.ts:1328

Health the game itself took for the blow on the machine that saw it land. Matches damage unless a perk that depends on the moment – a heavy weapon’s, a first strike’s – was in play, which the server leaves out.


modifiers: PlayerHitModifiers

Defined in: server/api.d.ts:1363

Scales on the server’s price; see PlayerHitModifiers. Ignored for an arrow.


perfectBlock: boolean

Defined in: server/api.d.ts:1393

The victim’s perfect block caught it. The game takes nothing for one.


priced: boolean

Defined in: server/api.d.ts:1333

Whether the server worked damage out itself: true for a swing, false for an arrow.


reason: "unknown" | "combat" | "gunshot" | "starvation" | "collision" | "scripted" | "disintegrate" | "fall" | "poison" | "bleeding" | "selfHarm"

Defined in: server/api.d.ts:1378

The game’s own reason for the damage: combat for a blade or a bow.


source: "melee" | "missile"

Defined in: server/api.d.ts:1383

Whether it was a swing or an arrow.


stamina: number

Defined in: server/api.d.ts:1368

Stamina the blow cost the victim. Already spent: stamina decides their next block, which cannot wait for a ruling.


weapon: string | null

Defined in: server/api.d.ts:1338

The attacker’s weapon as 32 hex digits, or null for a bare hand.