Name (Damage Condition Type)

Checks whether the damage source uses a specific name.

Checks whether the damage source uses a specific name.

Type ID: apoli:name

Fields

FieldTypeDefaultDescription
nameStringrequiredThe damage source’s message id. See the table below.

Damage source names

The name is the damage type’s message id — the message_id field of the damage type JSON, not the damage type’s own id. Several damage types deliberately share one, so apoli:name is a coarser check than apoli:type or apoli:in_tag; prefer those when you can.

NameDamage types that use it
inFireminecraft:in_fire, minecraft:campfire
lightningBoltminecraft:lightning_bolt
onFireminecraft:on_fire, minecraft:unattributed_fireball
lavaminecraft:lava
hotFloorminecraft:hot_floor
inWallminecraft:in_wall
crammingminecraft:cramming
drownminecraft:drown
starveminecraft:starve
cactusminecraft:cactus
fallminecraft:fall
flyIntoWallminecraft:fly_into_wall
outOfWorldminecraft:out_of_world
genericminecraft:generic
magicminecraft:magic
witherminecraft:wither
dragonBreathminecraft:dragon_breath
dryoutminecraft:dry_out
sweetBerryBushminecraft:sweet_berry_bush
freezeminecraft:freeze
stalagmiteminecraft:stalagmite
fallingBlockminecraft:falling_block
anvilminecraft:falling_anvil
fallingStalactiteminecraft:falling_stalactite
stingminecraft:sting
mobminecraft:mob_attack, minecraft:mob_attack_no_aggro, minecraft:mob_projectile, minecraft:spit, minecraft:wind_charge
playerminecraft:player_attack
arrowminecraft:arrow
tridentminecraft:trident
fireworksminecraft:fireworks
fireballminecraft:fireball
witherSkullminecraft:wither_skull
thrownminecraft:thrown
indirectMagicminecraft:indirect_magic
thornsminecraft:thorns
explosionminecraft:explosion
explosion.playerminecraft:player_explosion
sonic_boomminecraft:sonic_boom
badRespawnPointminecraft:bad_respawn_point
outsideBorderminecraft:outside_border
genericKillminecraft:generic_kill

A data pack that adds its own damage type sets its own message_id, and that name works here too.

Examples

"damage_condition": {
    "type": "apoli:name",
    "name": "inWall"
}

This example will check if the damage source name is inWall, meaning that the condition will evaluate to true if the entity is suffocating in a block.