Edit

Entity Documentation - minecraft:attack

Defines an entity's melee attack damage and any additional status effects applied on hit. Typical damage values range from 3 (zombie, creeper) to 7-21 (iron golem).

Attack Properties

Name Default Value Type Description
damage not set Range of floats Range of the random amount of damage the melee attack deals.
effect_amplifier 0 Integer number Amplifier level (potion tier) of the status ailment applied to the damaged entity.
effect_duration 0 Decimal number Duration in seconds of the status ailment applied to the damaged entity.
effect_name not set String Identifier of the status ailment to apply to an entity attacked by this entity's melee attack.

damage

Range of the random amount of damage the melee attack deals. A negative value can heal the entity instead of hurting it. Can be a number, an array [min, max], or an object with range_min and range_max properties.

effect_amplifier

Amplifier level (potion tier) of the status ailment applied to the damaged entity. Higher values increase the strength of the effect. Fixed in format version 1.26.30: effect_amplifier is now actually applied to the inflicted status effect, so amplifier-sensitive effects such as Hunger now scale correctly when triggered by a mob's melee attack. Prior versions silently ignored this value.

Samples