Jump to content

Recommended Posts

Posted (edited)

Hello I encountered an error that I'm having trouble resolving.

This is the error i got on console when i log the char into game

 

Could not restore char data: java.lang.NullPointerException

 

Screenshot_1.png

Edited by NifO_TOP
screen
  • 2 weeks later...
Posted
Provide the logs, it will give you details regarding the issue.

For now simply check for "Could not restore char data" on your project, and revert or fix your customs on the given method.

Basically you got a method call returning nothing ("null") while it should be set. Either you missed a != null check, or you messed up the logic.

Eg. if you do player.getInventory().addItem but never set _inventory before on that Player, then it ends as NPE because getInventory() isn't set and returns null.

So, null pointer exception.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This community uses essential cookies to function properly. Non-essential cookies and third-party services are used only with your consent. Read our Privacy Policy and We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue..