Skip to content

API reference / @jsprismarine/prismarine / entity/DamageCause

entity/DamageCause ​

Enumerations ​

DamageCause ​

Defined in: packages/prismarine/src/entity/DamageCause.ts:8

What hurt an entity. Carried through so a death can be reported as what it was, and so the things that ignore particular kinds of damage have something to test.

Its own file, because DamageSource names it and the store's damage pipeline names both, and a member of either would make the runtime import cycle the rules in biome.json prevent.

Enumeration Members ​

Attack ​

Attack: "attack"

Defined in: packages/prismarine/src/entity/DamageCause.ts:19

Struck by something holding a weapon, or a fist.

Contact ​

Contact: "contact"

Defined in: packages/prismarine/src/entity/DamageCause.ts:26

Walked into something that hurts to touch: a cactus, a berry bush.

Drowning ​

Drowning: "drowning"

Defined in: packages/prismarine/src/entity/DamageCause.ts:10

Explosion ​

Explosion: "explosion"

Defined in: packages/prismarine/src/entity/DamageCause.ts:22

Fall ​

Fall: "fall"

Defined in: packages/prismarine/src/entity/DamageCause.ts:12

Fire ​

Fire: "fire"

Defined in: packages/prismarine/src/entity/DamageCause.ts:14

Standing in flames, or burning after having stood in them.

Generic ​

Generic: "generic"

Defined in: packages/prismarine/src/entity/DamageCause.ts:9

Lava ​

Lava: "lava"

Defined in: packages/prismarine/src/entity/DamageCause.ts:16

In the lava itself, which hurts far faster than the fire it leaves behind.

Magic ​

Magic: "magic"

Defined in: packages/prismarine/src/entity/DamageCause.ts:30

Potions and the like, which armor does nothing about.

Projectile ​

Projectile: "projectile"

Defined in: packages/prismarine/src/entity/DamageCause.ts:21

Hit by something thrown or fired, which is not the same as being struck by its owner.

SelfDestruct ​

SelfDestruct: "self_destruct"

Defined in: packages/prismarine/src/entity/DamageCause.ts:39

An unconditional kill: the /kill command. Bedrock's self_destruct cause and Java's genericKill damage type, and like both of them it is not a blow anything can turn aside.

SonicBoom ​

SonicBoom: "sonic_boom"

Defined in: packages/prismarine/src/entity/DamageCause.ts:24

The warden's sonic boom, which passes through armor and its enchantments.

Starvation ​

Starvation: "starvation"

Defined in: packages/prismarine/src/entity/DamageCause.ts:11

Suffocation ​

Suffocation: "suffocation"

Defined in: packages/prismarine/src/entity/DamageCause.ts:28

A solid block where the entity's head is.

Thorns ​

Thorns: "thorns"

Defined in: packages/prismarine/src/entity/DamageCause.ts:33

Reflected back at an attacker by the armor they hit.

Void ​

Void: "void"

Defined in: packages/prismarine/src/entity/DamageCause.ts:17

Wither ​

Wither: "wither"

Defined in: packages/prismarine/src/entity/DamageCause.ts:31

Functions ​

damageCauseOf() ​

damageCauseOf(name): DamageCause

Defined in: packages/prismarine/src/entity/DamageCause.ts:57

Resolves a Java or Bedrock damage cause to the closest cause the server models.

Parameters ​

name ​

string

Returns ​

DamageCause

References ​

damageCause ​

Renames and re-exports DamageCause