Data component format/attack range

    • [NBT Compound / JSON Object] minecraft:attack_range: Determines the attack range and hitbox margin of a weapon.
      • [Float] min_reach: The minimum distance in blocks from the attacker to the target to be considered valid. Defaults to 0.0, valid from 0.0 to 64.0.
      • [Float] max_reach: The maximum distance in blocks from the attacker to the target to be considered valid. Defaults to 3.0, valid from 0.0 to 64.0.
      • [Float] min_creative_reach: The minimum distance in blocks from the attacker to the target to be considered valid in Creative mode. Defaults to 0.0, valid from 0.0 to 64.0.
      • [Float] max_creative_reach: The maximum distance in blocks from the attacker to the target to be considered valid in Creative mode. Defaults to 5.0, valid from 0.0 to 64.0.
      • [Float] hitbox_margin: The margin applied to the target bounding box when checking for valid hitbox collision. Defaults to 0.3, valid from 0.0 to 1.0.
      • [Float] mob_factor: The multiplier applied to min_range and max_range when checking for valid distance if item is used by a mob. Defaults to 1.0, valid from 0.0 to 2.0.


Notes