mojira.dev
MC-308623

Game crashes when trying to load crossbow with multishot enchantment level 32 or higher

Description

When I try to charge a crossbow enchanted with multishot 32 with an arrow or anything else, the game immediately crashes:

java.lang.IllegalArgumentException: Got 65 items, but maximum is 64

at net.minecraft.world.item.component.ChargedProjectiles.<init>(ChargedProjectiles.java:34)

at net.minecraft.world.item.component.ChargedProjectiles.ofNonEmpty(ChargedProjectiles.java:43)

at net.minecraft.world.item.CrossbowItem.tryLoadProjectiles(CrossbowItem.java:111)

at net.minecraft.world.item.CrossbowItem.onUseTick(CrossbowItem.java:224)

at net.minecraft.world.item.ItemStack.onUseTick(ItemStack.java:1108)

at net.minecraft.world.entity.LivingEntity.updateUsingItem(LivingEntity.java:3586)

at net.minecraft.server.level.ServerPlayer.updateUsingItem(ServerPlayer.java:2178)

at net.minecraft.world.entity.LivingEntity.updatingUsingItem(LivingEntity.java:3539)

at net.minecraft.world.entity.LivingEntity.tick(LivingEntity.java:2851)

at net.minecraft.world.entity.player.Player.tick(Player.java:276)

at net.minecraft.server.level.ServerPlayer.doTick(ServerPlayer.java:726)

…

This also happens with any multishot enchantment level higher than 32.


Steps to reproduce

  1. Run command /give @s minecraft:crossbow[enchantments={multishot:32}] 1

  2. Charge the crossbow


Expected result

Crossbow shoots 65 arrows


Actual result

Game immediately crashes

Environment

System is windows 11, tested on 26.2 Pre-Release 3 and 4

Linked issues

Comments 1

Please do not mark versions as affected without actually trying them.

Herobrine0101001

(Unassigned)

Unconfirmed

26.2 Pre-Release 4

Retrieved