mojira.dev
MC-274629

Multishot Enchant functionality changed

I am unsure when Mojang refactored a lot of the code regarding Crossbows/Bows, however whenever it happened, it appears a bug was introduced.

Before the change, whenever a crossbow with multishot was fired, the projectiles would first be shot, and then item damage would be dealt to the crossbow after (either 1 or 3 depending on the presence of multishot). Now, it instead iteratively shoots the projectile AND damages the crossbow in the same loop of ItemProjectileWeapon. This has the (likely unintended) side effect of introducing the following edge cases:

  • If a crossbow with multishot has durability of 1, only 1 arrow is shot and crossbow breaks.

  • If a crossbow with multishot has durability of 2, only 2 arrows are shot and crossbow breaks.

This behavior isn't the same as before the recode, whereas before it would shoot 3 projectiles in both cases.

Linked issues

Comments 2

Additionally, it appears there is code written to allow for enchantments to "consume" more than one item in order to fire if I am understanding the "useAmmo" method correctly.. While (as far as I know) that functionality is unused so far aside from returning 1, if it were to be used now it would result in items being consumed but possibly not fired without being returned to the player either.

Thank you for your report!
We're tracking this issue in MC-272806, so this ticket is being resolved and linked as a duplicate.

That ticket has already been resolved as working as intended, which means this is not considered a bug and won't be fixed. Please do not leave a comment on the linked ticket.

If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

Cynthia Yantis

(Unassigned)

Unconfirmed

(Unassigned)

1.21

Retrieved