Downsizing a world causes a crash
When decreasing world height using a datapack in the latest snapshot the game crashes. Removing the datapack does fix this again
In previous versions, doing this correctly truncates the chunks with no crashes or other major issues (although log errors are thrown each time a chunk is loaded for the first time after the change).
This may simply be unsupported behaviour, but the inconsistency with previous versions suggests an underlying technical change - if this is intentional then that's fine but it would be nice to have clarification, and/or a warning when loading the pack
Created Issue:
Downsizing a world causes a crash
When decreasing world height using a datapack in the latest snapshot the game crashes. Removing the datapack does fix this again
In previous versions, doing this correctly truncates the chunks with no crashes or other major issues (although log errors are thrown each time a chunk is loaded for the first time after the change).
This may simply be unsupported behaviour, but the inconsistency with previous versions suggests an underlying technical change - if this is intentional then that's fine but it would be nice to have clarification, and/or a warning when loading the pack
is duplicated by
testing discovered
is duplicated by
testing discovered
is duplicated by
With MC-276585 (discovered while testing!) having been in full releases, before getting fixed (resolution still pending), map makers were forced to increase world height in worlds that previously were less than 384 blocks high.
Now that it got fixed, a new problem becomes visible. Any world which has its height increased simply adds new empty chunk sections above/below existing chunk sections, but any world which has its height decreased resets the whole chunk.
This makes it so that any map which was forced to increase height can no longer go back to the original height it had.
Steps to reproduce:
- Install the data pack named "Extra Height.zip" in the attachments
- Open the world
- Use /execute in custom:test_dimension run teleport @s 0 15 0
- Build a structure you can recognize
- Close the world
- Install the data pack named "Less Height.zip" in the attachments
- Open the world
- Look for the structure you build.
Expected behavior
If the max Y is reduced, chunk sections on the top of the world would be removed until the new max Y.
If the min Y is increased, chunk sections on the bottom of the world would be removed until the new min Y.
Just like how increasing height just adds empty chunk sections to the same parts on the inverse cases.
Actual behavior
The entire chunk column is reset, removing anything build in the area that is expected to still exist.
The game log shows tons of exceptions being thrown, followed by chunk debug files being created (example (of the first world I noticed this behavior in) is attached).
[14:27:50] [Server thread/ERROR]: Failed to load chunk 291,-5 java.lang.ArrayIndexOutOfBoundsException: Index 16 out of bounds for length 16 at dyt.a(SourceFile:386) ~[server-1.21.4.jar:?] at dyt.a(SourceFile:304) ~[server-1.21.4.jar:?] at eao.a(SourceFile:328) ~[server-1.21.4.jar:?] at aqi.a(SourceFile:591) ~[server-1.21.4.jar:?] at java.base/java.util.concurrent.CompletableFuture$UniApply.tryFire(CompletableFuture.java:646) ~[?:?] at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?] at bra.d(SourceFile:164) ~[server-1.21.4.jar:?] at ara$b.d(SourceFile:602) ~[server-1.21.4.jar:?] at bra.B(SourceFile:138) ~[server-1.21.4.jar:?] at ara$b.B(SourceFile:611) ~[server-1.21.4.jar:?] at ara.d(SourceFile:277) ~[server-1.21.4.jar:?] at net.minecraft.server.MinecraftServer.bv(SourceFile:877) ~[server-1.21.4.jar:?] at net.minecraft.server.MinecraftServer.B(SourceFile:865) ~[server-1.21.4.jar:?] at bra.bA(SourceFile:123) ~[server-1.21.4.jar:?] at net.minecraft.server.MinecraftServer.x_(SourceFile:833) ~[server-1.21.4.jar:?] at net.minecraft.server.MinecraftServer.y(SourceFile:719) ~[server-1.21.4.jar:?] at net.minecraft.server.MinecraftServer.a(SourceFile:292) ~[server-1.21.4.jar:?] at java.base/java.lang.Thread.run(Thread.java:1570) [?:?]
This issue and MC-276585 will alternate in presence between snapshots and full releases - we try to be more strict with catching crashes in full releases. As they’re the same underlying issue, can they be merged back into the original issue? Thanks!
Resolving as a duplicate of MC-276585 instead since the report in your comment is a duplicate of it as well.
Has the world been decreased in height by a data pack at any point? (MC-276585)
B4dAtMC, Java Edition is supposed to works fine when updating, all data formats are updated by the game. Changing version numbers should not cause the game to break (unless you downgrade). Additioanlly, no commands are provided, so why do you think commands are a problem in this? Command syntax changing doesn't cause crashes.


Can confirm:

Confirmed for 1.21.2-pre1, here's my world that's also affected: https://www.mediafire.com/file/4e38p1miwd1pvmi/MC-277476_-_altered_world_copy.zip/file
This needs fixing before release, or map makers are going to be severely hindered from updating their maps.
Still in pre-release 5.
Still in 1.21.2 RC1
And still in RC2. If a mod/helper oor the reporter would add this version, unlike the last 2 versions I confirmed it for....
And it is now in the full release of 1.21.2...
This has been fixed somewhere between 1.21.2 and 1.21.4.
This seems to have been fixed in 1.21.4-Release Candidate 1, the world no longer seems to crash but it displays this error whenever loading into the world:

This has been reported in
MC-279119