[Solved]Weird Message that only shows during the world load phase

So I’m pretty sure it’s getting this error message because entities before the world start are null…but for performance reasons i’d obviously like to anialate this issue…here’s the Code and here s the Error Log

Please help me with any thoughts on how to avoid this from happening. Thanks :smiley:

The crash report is pretty clearly saying that the error is a NullPointerException at HOB.java line 454, or 209, or 269, etc. The only real code at that line is ConfigurationManager.getInstance().getConfig().getNode("Spawning!", "Pig", "Pig#").getInt(), and the stack trace says that your method is the top layer meaning that it can’t be any of the Configurate calls. So either ConfigurationManager.getInstance() returns null, or ConfigurationManager.getInstance().getConfig() returns null.

Also, you may want to use booleans instead of Strings in your configuration and doubles instead of ints for percentages, as well as move the repeated code outside the if statements to make it only need to be written once.

Ok…but can you explain why it does this only during the loading? it literally never does any of those error messages after the server says Done!(5.231s) I’m looking into those lines…but there’s nothing wrong with them…they work like they should every single time during the game…so help? :’(

No, I can’t explain that, because I don’t know the contents of ConfigurationManager.java, which is where the stuff is null in the first place.

Probably because you only setup the config at GameStartingServerEvent? Configs are available at GamePreInitializationEvent, you should set it up then.

1 Like

please help
OMG! THANK YOU SOOOO MUCH!!!