Need help with 'java.lang.NullPointerException' issue on server
Good morning lovely people. We are getting an exception on our server/multiplayer console which is causing DH to not work correctly. (LODs are not being sent to the client from server) We have distant generation enabled on our client side.
It was working when we first started the server 2 days ago but now its throwing a 'java.lang.NullPointerException' on the console as of yesterday. We are on Minecraft version 1.21.1 (fabric) using the 'DistantHorizons-fabric 2.3.3-b-dev-1.21.1 jar' from the NightlyBuild_1.21.1-1b9d14e7-2025-06-17T07_15_36-05_00.zip folder from the links & downloads channel.
Here is a recent log of the exceptions/errors:
https://mclo.gs/xStQRTe
Here are the mods we are currently using (Server is hosted on modrinth):
cloth-config-15.0.140-fabric.jar
DistantHorizons-fabric-2.3.3-b-dev-1.21.1.jar
dungeons-and-taverns-v4.4.4 (1).jar
EasyShulkerBoxes-v21.1.2-1.21.1-Fabric.jar
fabric-api-0.116.2+1.21.1.jar
fabric-seasons-2.4.2-BETA+1.21.jar
FallingTree-1.21.1-1.21.1.9.jar
ForgeConfigAPIPort-v21.1.3-1.21.1-Fabric.jar
guardvillagers-2.1.2-1.21.jar
HorseBuff-1.21-2.1.8.jar
HorseExpert-v21.1.0-1.21.1-Fabric.jar
immersive-winds-1.21.1-0.8.jar
leafmealone-1.0.1.jar
lithium-fabric-0.15.0+mc1.21.1.jar
noisium-fabric-2.3.0+mc1.21-1.21.1.jar
PuzzlesLib-v21.1.36-1.21.1-Fabric.jar
Let me know if you need additional info. Thank you!

6 Replies
I did try a few basic troubleshooting steps noted below:
Changed distantGeneratorMode = "FEATURES" to distantGeneratorMode = "INTERNAL_SERVER" and changed enableDistantGeneration = false to enableDistantGeneration = true separately in the distanthorizons.toml file but the console still had the same DH exception messages. I've reverted these changes back to distantGeneratorMode = "FEATURES" and enableDistantGeneration = false in the .toml file.
Also the sqlite files are in the data folder and it looks like its correctly storing the LOD data. Thank you!

Does this happen with only DH installed?
If not, try a !binary search
Try a binary search and figure out which mod is causing it.
So disable half of the mods, see if issue is still there, if yes disable half again etc etc until you find the mod that's causing the issue.
I disabled all mods except for DH and the same errors in the logs are happening when I loadinto the world. The only other thing thats enable besides DH is a datapack called 'JJthunder to the max'. However when we first booted up the world we only had JJ Thunder to the max and DH enabled and it was working fine a few days ago
This issue still isn't resolved, looking for a little guidance on what might be going wrong
.
[08:39:03] [DH-PriorityTaskPicker Thread[19]/ERROR]: Unexpected issue getting request for pos [8*0,3], error: [java.lang.NullPointerException: Cannot invoke "java.util.concurrent.CompletionStage.toCompletableFuture()" because the return value of "java.util.function.Function.apply(Object)" is null].
java.util.concurrent.CompletionException: java.lang.NullPointerException: Cannot invoke "java.util.concurrent.CompletionStage.toCompletableFuture()" because the return value of "java.util.function.Function.apply(Object)" is null
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315) ~[?:?]
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320) ~[?:?]
at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1159) ~[?:?]
at java.base/java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:482) ~[?:?]
at knot/com.seibel.distanthorizons.core.util.threading.PriorityTaskPicker$TrackedRunnable.run(PriorityTaskPicker.java:203) ~[DistantHorizons-fabric-2.3.3-b-dev-1.21.1.jar:?]
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) ~[?:?]
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) ~[?:?]
at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
Caused by: java.lang.NullPointerException: Cannot invoke "java.util.concurrent.CompletionStage.toCompletableFuture()" because the return value of "java.util.function.Function.apply(Object)" is null
at java.base/java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:1150) ~[?:?]
.
This is the error message we constantly receive and cannot make sense of