1. Wiki
  2. /Items
  3. /minecraft:piercing_weapon

minecraft:piercing_weapon

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

Overview

minecraft:piercing_weapon is an item component: it goes in the components object of a custom item. Makes an attack hit every mob in a straight line in front of the user, like a spear thrust. Items with this cannot break blocks, because attacking always comes first.

Fields

FieldTypeDefaultDescription
reachFloatRange{"max":3,"min":0}How far ahead (in blocks) targets can be hit. Blocks in the way stop the hit.
creative_reachFloatRangenoneReach used in Creative mode. Uses reach if left out.
hitbox_marginnumber0Extra room around the aim line, so targets slightly off center still count.

Example

Inside the components object of BP/items/<name>.json (values are the defaults or placeholders):

BP/items/<name>.json
{
  "minecraft:piercing_weapon": {
    "reach": {
      "max": 3,
      "min": 0
    },
    "creative_reach": 1,
    "hitbox_margin": 0
  }
}

Items: Behavior pack

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