mojira.dev
MC-272099

Insufficient ammo on custom enchantments glitches the item

Description:

Even though the enchantment ammo use value is bigger than the amount of ammo item in inventory, the player can still use the item. The weapon cannot shoot any arrows as expected. However, the shooting and drawing sounds are still played and crossbow gets stuck in the fully charged model.

This is related to MC-271566.

Steps to reproduce:
1) Download the example

[media]

data pack and put it on your world.

2) Grab a bow/crossbow and enchant it with this command:

/enchant @s test_datapack:test_enchantment 5

3) Get 1 arrow and switch to survival mode.

4) Try to shoot with the item. Observe that it is still usable.

Here is a video that summarizes the issue:

[media]

Expected Result ✅:

• The item shouldn't be usable.

Observed Result ❌:

The item is still usable and causes animation issues.

Attachments

Comments 2

This issue persists on 1.21.4, only difference is that the crossbow works as normal but it takes no arrows from your inventory, making it infinite ammo instead.

Wyvernity

(Unassigned)

Community Consensus

Platform

Low

Enchantments

24w20a, 1.21.1, 24w35a

Retrieved