[SPIGOT-6076] NPE and server crash sending multi-block-change packets for uninitialized chunk sections Created: 14/Aug/20  Updated: 16/Aug/20  Resolved: 16/Aug/20

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: James E Hopkins Assignee: Unassigned
Resolution: Fixed Votes: 2
Labels: None

Attachments: Java Source File TestPlugin-1.java     Java Source File TestPlugin.java     Text File latest.log    
Version: git-Spigot-379750e-1e76d09 (MC: 1.16.2)
Guidelines Read: Yes

 Description   

The server only tracks 16x16x16 chunk sections once blocks are present in them. Otherwise, those chunk sections are null. The issue with this is that we can interact with those null chunk sections and have them still be null - for example, by sending players fake block changes. When you go to update more than 1 of those block states back to being air, the server constructs PacketPlayOutMultiBlockChange packets that may contain null chunk sections. When this happens, the entire server crashes from an NPE in the packet's constructor.

The server should be patched to check whether the chunk section is null and initialize it before constructing the multi block change packet.

This issue only appears to be present on 1.16.2



 Comments   
Comment by Eccentric Devotion [ 16/Aug/20 ]

I'm getting this same error just calling Chunk#load()

Comment by James E Hopkins [ 14/Aug/20 ]

NMS was only used to print whether the chunk sections were null. You can remove that section and reproduce the same way. I attached a version without it.

Comment by md_5 [ 14/Aug/20 ]

NMS is not supported, please provide a way to reproduce without it

Generated at Sat Dec 13 13:42:44 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.