mojira.dev
MC-150215

Crossbow piercing arrow damage is randomized every time it passes through a mob

The damage from a Piercing arrow is randomized every time it passes through a mob, instead of remaining the same after being shot from the crossbow.

To reproduce

  • Obtain a Piercing IV crossbow

  • Summon 5 or less 20-health mobs (e.g. creepers) lined up with {NoAI:1b}

  • Shoot the crossbow so that the arrow hits all of the mobs

  • Repeat several times

As shown in this video, some mobs will die after taking two hits, while others take three; the mobs that die change every time this is repeated. The remaining health of the mobs that survive two hits also changes every time, usually between 1-4 HP. This could make advancements such as "Two Birds, One Arrow" and "Arbalistic" trickier to get, since the mobs could take a different number of hits to kill despite starting out with the same health and being damaged by the same arrow.

Code analysis

Crossbow arrows shot by players always do critical damage; the random critical damage bonus is calculated on every hit instead of once when the arrow is spawned.

Attachments

Comments 10

This report has not been updated recently for over 1 year, does this still affects 1.16.2?

Can confirm that this is still an issue in 20w51a.

Can confirm in 21w03a. You can use this following command to obtain the crossbow showcased in the video.

/give @s minecraft:crossbow{Enchantments:[{id:"piercing",lvl:4},{id:"quick_charge",lvl:3},{id:"unbreaking",lvl:3}]}

Can confirm in 21w05a.

Can confirm in 21w06a.

Can confirm in 21w07a.

Can confirm in 1.16.5 and 21w08b.

Can confirm in 1.17.

Can confirm in 1.17.1.

Can confirm in 1.18.1.

Sonicwave

(Unassigned)

Confirmed

Items

Minecraft 1.14, 1.16.3 Release Candidate 1, 1.16.3, 20w51a, 21w03a, ..., 21w08b, 1.17, 1.17.1, 1.18.1, 1.20.1

Retrieved