DrSpuick Posted August 5, 2024 Posted August 5, 2024 (edited) Hello everyone, I'm struggling with a weird issue, I'm trying to make a server pack for a new modpack and sometime I can join the server but got immediately disconnected with the message below: Quote Connection Lost Internal Exception: java.lang.NullPointerException: Cannot invoke "net.minecraft.nbt.CompoundTag.m_128459_(String)" because "nbt" is null Expand I've seen seen other posts with the same error but nobody mention how they fix it (if they really fixed it). Issue: Here is the weird part, I have two scenarios occuring : I start my client, join the server, everything is fine. I can disconnect/reconnect to the server. It works. I start my client, join the server, get disconnected with the message above. If I try to reconnect, I will always get the same error. I must restart the client and hope this time it will works. Additional informations: I have tried with Forge 43.2.0, 43.3.0 (stable) and 43.3.5 (latest) on both server and client with the same results. The server pack is created using ServerPackCreator. There is no problem in single player mode. I can't determine if this could be a mod or a Forge issue. I suspect there is somewhere an unstable loading order that could explain that problem. I can't find anything of interest in the server and client debug.log (or I don't know what to look for). Logs: Client (debug.log): https://mclo.gs/4jf8lz7 Server (debug.log): https://mclo.gs/aT3hgEG Any help or hint to find the culprit appreciated . Thanks for reading Edited August 6, 2024 by DrSpuick Quote
DrSpuick Posted August 14, 2024 Author Posted August 14, 2024 Bump. Anyone as encountered the same issue? Quote
deus_ Posted January 12 Posted January 12 were you able to figure out which mod is causing this problem? Quote
deus_ Posted January 12 Posted January 12 This error occurs when you are trying to invoke a method on a null object reference. In this case, the variable "nbt" is null, meaning it doesn't point to any object. To fix this issue, you need to make sure that the "nbt" variable is properly initialized before trying to invoke any method on it. You can check if the "nbt" variable is null before calling the method, or ensure that it is properly assigned a value from a valid object. Here is an example of how you can handle this issue: sqlCopy code if (nbt != null) { // Call the method on the "nbt" object nbt.m_128459_("String"); } else { // Handle the case when "nbt" is null System.out.println("Error: nbt is null"); } Make sure to review your code and find out where the "nbt" variable should be initialized before using it. were you able to figure out which mod is causing this problem? https://chat-gpt.org/chat Quote
Ugdhar Posted January 12 Posted January 12 On 1/12/2025 at 9:36 AM, deus_ said: This error occurs when you are trying to invoke a method on a null object reference. Expand This section of the forum is for support running forge, not modder support. Based on their post, they are creating a modpack from mods other people created, not writing a mod, so do not have access to the sourcecode. ChatGPT steered you wrong in this case, AI is not that intelligent lol. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.