The snake_case string a EntityDamageSource.cause carries.
Enum in @minecraft/server
The snake_case string a EntityDamageSource.cause carries.
import { EntityDamageCause } from '@minecraft/server';Example
Section titled “Example”import { EntityDamageCause } from '@minecraft/server';
const value: EntityDamageCause = EntityDamageCause.anvil;console.log(value); // "anvil"import { EntityDamageCause } from '@minecraft/server';
const value = EntityDamageCause.anvil;console.log(value); // "anvil"Values
Section titled “Values”| Name | Value | Description |
|---|---|---|
anvil |
"anvil" |
|
blockExplosion |
"block_explosion" |
|
campfire |
"campfire" |
|
charging |
"charging" |
|
contact |
"contact" |
|
drowning |
"drowning" |
|
entityAttack |
"entity_attack" |
|
entityExplosion |
"entity_explosion" |
|
fall |
"fall" |
|
fallingBlock |
"falling_block" |
|
fire |
"fire" |
|
fireTick |
"fire_tick" |
|
fireworks |
"fireworks" |
|
flyIntoWall |
"fly_into_wall" |
|
freezing |
"freezing" |
|
lava |
"lava" |
|
lightning |
"lightning" |
|
magic |
"magic" |
|
magma |
"magma" |
|
none |
"none" |
|
override |
"override" |
|
piston |
"piston" |
|
projectile |
"projectile" |
|
ramAttack |
"ram_attack" |
|
selfDestruct |
"self_destruct" |
|
sonicBoom |
"sonic_boom" |
|
soulCampfire |
"soul_campfire" |
|
stalactite |
"stalactite" |
|
stalagmite |
"stalagmite" |
|
starve |
"starve" |
|
suffocation |
"suffocation" |
|
temperature |
"temperature" |
|
thorns |
"thorns" |
|
void |
"void" |
|
wither |
"wither" |
Used by
Section titled “Used by”EntityDamageSource.cause, EntityApplyDamageOptions.cause, EntityHurtAfterEventOptions.allowedDamageCauses, EntityHurtBeforeEventOptions.allowedDamageCauses