Mojira Archive
MC-271753

Crash due to overflow inside cost calculation in by_cost_with_difficulty

When the by_cost_with_difficulty enchantment provider calculates the cost, the maximum value may overflow, causing max - min + 1 to be zero or below. This causes a crash.

Steps to Reproduce

  1. Create a new world with the attached data pack.
  2. Place a zombie spawner.
  3. Ensure the local difficulty is near the maximum (set the difficulty to Hard, and advance inhabited time/time of day; using pre-existing world might be a better idea)
  4. Wait.

Expected Result
Game does not crash.

Actual Result
Game crashes.

Fixed

apple502j

[Mojang] TommyWallberg

2024-05-08, 12:29 PM

2024-05-22, 09:44 AM

2024-05-22, 09:44 AM

1

1

Plausible

Very Important

Platform

Crash, Data Packs, Enchantments

24w18a

24w21a