mojira.dev
MC-220067

Chunk corruption with command block full of certain Unicode characters

The bug

When a command block is full of characters that take more than 1 byte to store, the chunk that command block is in gets corrupted.

How to reproduce

  1. Place a command block down.

  2. Copy and paste this symbol "■" into the command block until the command block is full.

  3. Save and quit to title.

  4. Get back in the world.
    → ❌ The chunk the command block was in is re-generated; resetting everything in it

Note

■ is not the only character this works with.

Game output error message

Failed to store chunk [7, 1]
java.io.UTFDataFormatException: encoded string (...) too long: 97500 bytes
	at java.base/java.io.DataOutputStream.writeUTF(DataOutputStream.java:368)
	at java.base/java.io.DataOutputStream.writeUTF(DataOutputStream.java:332)
	at nq.a(SourceFile:65)
	at na.a(SourceFile:415)
	at na.a(SourceFile:104)
	at ng.a(SourceFile:81)
	at na.a(SourceFile:415)
	at na.a(SourceFile:104)
	at na.a(SourceFile:415)
	at na.a(SourceFile:104)
	at nk.a(SourceFile:95)
	at nk.a(SourceFile:83)
	at cnq.a(SourceFile:70)
	at cnm.a(SourceFile:153)
	at cnm.a(SourceFile:143)
	at ara$b.run(SourceFile:61)
	at aqy.g(SourceFile:91)
	at aqy.a(SourceFile:146)
	at aqy.run(SourceFile:102)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
	at java.base/java.lang.Thread.run(Thread.java:831)

Video

https://youtu.be/C4t2avl0Dhw
(Video by Phoenix SC)

Attachments

Comments 15

You are overloading the chunk with information. When you do this, it resets to its latest save.

I was able to reproduce this in both 21w11a and 1.16.5. Additionally, after you click "Done" on the command block, the launcher crashes. The game itself (Java) remains open. It's easiest to notice the launcher crashing if you have the launcher log open (by selecting "Open output log when Minecraft: Java Edition starts" in the launcher settings before you launch the game). However, even if you don't have the launcher log open, you can still observe the launcher crashing by watching Activity Monitor (on macOS) or Task Manager (on Windows).

Perhaps this report should be moved to the MCL project? Or maybe a separate MCL report should be created and linked to this report? I'm unsure whether the chunk resetting is a side-effect of the launcher crashing, or if it is a separate issue.

After discussing this on the Mojira Discord, I created a separate report about the launcher crash: MCL-17439.

Can confirm in 1.17 Release Candidate 2.

Can confirm in 1.17.1.

5 more comments

Can confirm in 1.18.2 Pre-release 3.

In 22w19a and 1.18.2..

I can confirm this in 1.19 Pre-release 1. I reproduced this issue using the steps provided in MC-250918 and rebooting the server whilst the command block was still present in the world. Here's the server log.

[media]

Creeper Juice

slicedlime

Confirmed

Very Important

Chunk loading

1.16.5, 21w11a, 1.17 Release Candidate 2, 1.17, 1.17.1, ..., 22w18a, 22w19a, 1.19 Pre-release 1, 1.19 Pre-release 2, 1.19 Pre-release 3

1.19 Pre-release 4

Retrieved