mojira.dev
MC-275244

Setting "width_smoothness" in file configured_carver to 0 causes the game to freeze or crash

In data pack file worldgen/configured_carver/*.json, if you set value "width_smoothness" a negative number like -1, the game outputs:

at net.minecraft.client.main.Main.main(SourceFile:256)
Caused by: java.lang.IllegalStateException: Value must be non-negative: -1
at com.mojang.serialization.DataResult$Error.getOrThrow(DataResult.java:287)

0 is a non-negative and integer number. When you try to load a data pack where the value "width_smoothness" is 0 before you create a new world, the game output doesn't throw errors. 

I made this carver be enabled only in the dimension "test:width_smoothness_value_0", not in "minecraft:overworld".
Next, create a new world. You are spawned in the dimension "minecraft:overworld". Run this command: /execute in test:width_smoothness_value_0 run tp ~ ~ ~

The game attempt to load new terrain on new dimension and the game outputs:

---- Minecraft Crash Report ----
...
Description: Exception generating new chunk
java.lang.IllegalArgumentException: Bound must be positive
...

You will see the "Loading Terrain" screen for a long time. If you are lucky you will enter a completely empty world. if you quit the world you only see the "Saving world" screen. Only Task Manager can close the game.

What I expected to happen was...:
If players attempt to add these data packs, the game outputs a warning that the "width_smoothness" only accepts positive integers, not only warning that it needs a non-negative.
Or: The game accepts the value 0 and generates terrain normally.

What actually happened was...:
The game accepts the value 0 but the game freezes or crashes, the game output throws errors.

Steps to Reproduce:

  1. (Optional)Load the data pack "value_-1.zip" and check the content of the game output.

  2. Load the data pack "value_0.zip" and select the world preset "value_0".

  3. Create the world.

  4. When you enter the overworld, run the command: /execute in test:width_smoothness_value_0 run tp ~ ~ ~

  5. You will see the game freezes or crashes.

Attachments

Comments 3

Please attach the full game output log showing the error.

Ok, I've attached lates.log and a file output of the launcher after the crash

wplxfore

(Unassigned)

Community Consensus

Platform

Normal

Crash, Data Packs, World generation

1.21.1, 24w33a, 24w35a, 24w40a, 1.21.2, ..., 1.21.3, 1.21.4, 1.21.5, 25w15a, 1.21.6

Future Update

Retrieved