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
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.
Can confirm:
[media]