mojira.dev
MC-313773

Arrows do not retain certain enchantments once collided with a surface

Arrows shot by piercing arrows or punch bows do not retain their properties to pierce through multiple enemies or apply knockback once it collided with a wall.

To replicate the issue with piercing arrows, first open a world and make an encasing for any mob, which in my case a villager. place a block above the head of the villager, and shoot an arrow shot by a crossbow with any level of the piercing enchantment, then break the block.

Expected result: The arrow remains for further piercing

Actual result: The arrow disappears

To replicate for punch arrows, open a world and summon a villager. Apply slowness 255 to the villager to slow it down. place a block above the villager’s head, and shoot an arrow shot by a punch bow, preferably with a high level for better visualization, and break the block.

Expected result: the villager gets knocked back far due to the punch enchantment.

Actual result: The villager barely gets knocked back.

Comments 1

On initial thought possibly two different effects -

When AbstractArrow#onHitBlock() sets the pierce level to 0, the arrow gets discarded after next mob hit. Punch is not cleared, but hitting the block zeros velocity.

doKnockback() uses the arrow’s horizontal movement, which explains the weak push

Sean

(Unassigned)

Unconfirmed

26.3

Retrieved