1. Wiki
  2. /Entities
  3. /minecraft:damage_sensor

minecraft:damage_sensor

Don't want to write this by hand? GodCraft sets minecraft:damage_sensor for you with a switch.Get GodCraft

Overview

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

FieldTypeDefaultDescription
triggersListnoneList 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": {}
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more