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
Create a new world with the attached data pack.
Place a zombie spawner.
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)
Wait.
Expected Result
Game does not crash.
Actual Result
Game crashes.
I wasn't able to reproduce this, the game didn't seem to crash. Can you please provide a video showcasing the crash?