mojira.dev
MC-271715

Crash when the sum of enchantments' weights overflow

Summary
When an enchantment has a big weight (close to Integer.MAX_VALUE), adding other enchantments' weights will make the total exceed the integer limit, causing a crash.

Steps to Reproduce

  1. Create a world with the attached data pack, which makes the Sharpness enchantment have Integer.MAX_VALUE weight.

  2. Summon a villager.

  3. Place a grindstone.

Expected Result
The data pack should fail to load, or no crash should occur.

Actual Result
Game crashes.

Attachments

Comments 1

apple502j

slicedlime

Confirmed

Platform

Important

Crash, Data Packs

24w18a

24w20a

Retrieved