minecraft:damage_sensor for you with a switch.Get GodCraftOverview
minecraft:damage_sensor is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Reacts when the entity takes damage: you can run events, ignore certain damage or change how much it hurts. Great for immunities, like making a mob ignore fall damage.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
triggers | List | none | List of rules, each with the damage it watches for and what happens. |
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
BP/entities/<name>.json
{
"minecraft:damage_sensor": {
"triggers": {}
}
}