minecraft:piercing_weapon

Allows an item to deal damage to all entities detected in a straight line along the user's view vector. Items with this component cannot destroy blocks, as the attack action always takes priority, regardless of what the user is looking at.

Properties

PropertyTypeDefaultWhat it does
reachObject{"max": 3, "min": 0}Defines the range (in blocks) along the user's view vector where entities can be hit. Only targets within this distance are considered. Block collisions between the user and target block damage and its effects.
minDecimal0
maxDecimal0
creative_reachObject—Defines the reach used when the user is in Creative Mode. Defaults to "reach" if unspecified.
minDecimal0
maxDecimal0
hitbox_marginDecimal0Added tolerance to the view vector raycast for detecting entity collisions.

Example from the game files

This is how vanilla copper_spear uses it in Minecraft Bedrock 1.26.60.5:

{
  "minecraft:piercing_weapon": {
    "reach": {
      "min": 2.0,
      "max": 4.5
    },
    "creative_reach": {
      "min": 2.0,
      "max": 7.5
    },
    "hitbox_margin": 0.25
  }
}

Used by 7

Vanilla items with minecraft:piercing_weapon in their definition:

copper_speardiamond_speargolden_speariron_spearnetherite_spearstone_spearwooden_spear

Related components