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

minecraft:area_attack

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

Overview

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

FieldTypeDefaultDescription
causeStringnoneThe damage type dealt, such as contact or fire.
damage_cooldownDecimal"0"Seconds between two hits on the same target.
damage_per_tickInteger"2"Damage dealt each tick to entities in range.
damage_rangeDecimal"0.2"How close, in blocks, an entity must be to take damage.
death_message_overrideStringnoneA translation key shown as the death message when this attack kills someone. Leave empty to use the normal message.
entity_filterMinecraft FilternoneWhich entities can be hurt by the area attack.
play_attack_soundBoolean"true"If true, the entity plays its attack sound when it deals damage.
use_self_as_damage_sourceBoolean"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"
  }
}

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