mojira.dev
MC-313736

Enchantment minecraft:projectile_count with huge value crashes the game

A custom enchantment setting minecraft:projectile_count to 2147483647 is accepted so when a crossbow with this enchantment is loaded the game crashes.


Steps to reproduce:

  • Create a new world with the attached data pack enabled

  • Run the following commands:

    /summon minecraft:pillager ~ ~ ~ {equipment:{mainhand:{id:"minecraft:crossbow",count:1,components:{"minecraft:enchantments":{"test:huge_proj":1}}}}}
    /summon minecraft:iron_golem ~4 ~ ~
  • Wait for the pillager to finish loading its crossbow and observe the crash.


Observed result:
The game crashes

Expected result:
The projectile count value should be clamped to a reasonable upper limit :}

Attachments

Comments 2

Thank you for helping us improve Minecraft! We saved your files:

[media]

BugTracker - BugTX

(Unassigned)

Unconfirmed

26.3

Retrieved