Skip to content

Check Damage Type

Check if the damage type of a damage source is of a type or if it's included in a damage type tag.

Type ID: kaya:check_damage_type

Format

Field Type Default Description
key Identifier optional If specified, checks if the damage type of the damage source is of this specific type.
tag Damage Type Tag optional If specified, checks if the damage type of the damage source is included in this damage type tag.
damage_source Damage Source Provider The damage source to check.
Warning

Both key and tag fields should not be present or absent at the same time! Otherwise an error will be thrown.

Example

{
    "type": "kaya:check_damage_type",
    "tag": "#minecraft:is_fall",
    "damage_source": "taken_damage/source"
}

This example will check if the damage type of the damage source provided by the kaya:taken_damage/source context parameter is included in the #minecraft:is_fall damage type tag.

History

Minecraft Mod Changelog
1.21.5 0.1.0 Added the type.