ItemComponent - Piercing Weapon Component Apply (Section) — SkBee

Addon: SkBee · Category: Section · Since: 3.16.0

Syntax

apply piercing weapon component to %itemstacks/itemtypes/slots%

Description

Melee attacks using this item damage multiple entities along a ray, instead of only a single entity. Also prevents this item from being used to mine blocks. See [**Piercing Weapon Component**](https://minecraft.wiki/w/Data_component_format#piercing_weapon) on McWiki for more details. Requires Minecraft 1.21.11+

**ENTRIES**: All entries are optional and will use their defaults when omitted. - `deals_knockback` = Boolean, whether the attack deals knockback. Defaults to true. - `dismounts` = Boolean, whether the attack dismounts the target. Defaults to false. - `sound` = String, sound key to play when a player attacks with the weapon. - `hit_sound` = String, sound key to play when the weapon hits an entity.

Examples

set {_i} to 1 of stick
apply piercing weapon component to {_i}:
	deals_knockback: true
	dismounts: true
	sound: "minecraft:item.spear.attack"
	hit_sound: "minecraft:item.spear.hit"

give player 1 of {_i}

View source