minecraft:area_attack for you with a switch.Get GodCraftOverview
minecraft:area_attack is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Hurts any entity that comes close enough, like a pufferfish puffed up. No swing is needed: just being near is enough.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
cause | String | none | The damage type dealt, such as contact or fire. |
damage_cooldown | Decimal | "0" | Seconds between two hits on the same target. |
damage_per_tick | Integer | "2" | Damage dealt each tick to entities in range. |
damage_range | Decimal | "0.2" | How close, in blocks, an entity must be to take damage. |
death_message_override | String | none | A translation key shown as the death message when this attack kills someone. Leave empty to use the normal message. |
entity_filter | Minecraft Filter | none | Which entities can be hurt by the area attack. |
play_attack_sound | Boolean | "true" | If true, the entity plays its attack sound when it deals damage. |
use_self_as_damage_source | Boolean | "true" | If true, the damage counts as coming from this entity. Set to false so victims do not fight back or react as if attacked. |
Example
Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):
BP/entities/<name>.json
{
"minecraft:area_attack": {
"cause": "",
"damage_cooldown": "0",
"damage_per_tick": "2",
"damage_range": "0.2",
"death_message_override": "",
"entity_filter": {},
"play_attack_sound": "true",
"use_self_as_damage_source": "true"
}
}