Skip to main content

Name (Damage Condition Type)

Checks whether the damage source uses a given 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, which is the message_id field of the damage type JSON and not the damage type's own ID. Several damage types share one on purpose, so apoli:name is a coarser check than apoli:type or apoli:in_tag, and those are better when you can use them.

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 checks whether the damage source name is inWall, so the condition is true when the entity is suffocating in a block.