Jump to content

[Solved] [1.16.5] Random NullPointerException on launch....?


Recommended Posts

Posted (edited)

When trying to test my mod it crashes with a NullPointerException. But it doesn't point to any of my code, just an attempt to compare a TranslationTextComponent....somewhere.

I've tried checking the method references but there's literally hundreds of places it can point to, and so far nothing I've checked leads anywhere near my code.

Does anyone have any idea what would cause this?

Crash log: 

  Reveal hidden contents

 

Edited by SapphireSky
solved
Posted
  On 9/9/2021 at 3:36 AM, poopoodice said:

Does 1.16.5 support java 15?

Expand  

My Eclipse is using that as default, but my project is using 1.8. I'm guessing the printout does a generic Java version check instead of checking the version that's actually being used? But that wasn't the problem anyway.

  On 9/9/2021 at 6:18 AM, diesieben07 said:

Do you create a new TranslationTextComponent anywhere? Show your items and blocks and their registrations.

Expand  

This was it! When overriding the method to define Item names I forgot to change the automatically-placed TranslationTextComponent to StringTextComponent. I'm not sure why that didn't come up in the initial reference search, but it's working now.

  • SapphireSky changed the title to [Solved] [1.16.5] Random NullPointerException on launch....?
Posted
  On 9/9/2021 at 4:07 PM, diesieben07 said:

This is not how this works.

The item names should be defined in your language files, not anywhere else.

Expand  

Well that is how it's working for me, and it is working.

And yes I know they're supposed to be. But they don't need to be, so if I can avoid the hassle of having yet another reference file to constantly edit, I'm gonna do it. The only argument to use the language file is for other people to be able to edit the names to translate them, and very few people actually ever do that, so I just don't care. It works just as well, and if anything is slightly more efficient not using one. Just because the creators of something want us to do something their way, doesn't mean it's at all required or even bad to do otherwise.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.