Jump to content

Recommended Posts

Posted

I'm getting a NullPointer on this code:

Spoiler

for (Entity entity : Minecraft.getInstance().world.getAllEntities())

 

I don't understand how it can be null because the line right before it is:

Spoiler

if(Minecraft.getInstance().world.getAllEntities() != null && Iterables.size(Minecraft.getInstance().world.getAllEntities()) > 0)

 

Heres the Git repo: https://github.com/Novarch129/JoJo-s-Blocky-Adventure,

the relevant code is at :https://github.com/Novarch129/JoJo-s-Blocky-Adventure/blob/master/src/main/java/com/novarch/jojomod/entities/stands/kingCrimson/EntityKingCrimson.java,

and the debug.log: https://gist.github.com/Novarch129/38e8edc698dcafd745e05e7bb04d7d7e.

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

Posted
27 minutes ago, diesieben07 said:

Minecraft is a client-only class. You cannot access it from common code (your entity).

Then how should I run that code? The entire mod is entity classes and I don't think I can change that.

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

Posted
Just now, diesieben07 said:

What are you trying to do there even? What's the end goal?

Eventually add effects to all entites and remove their attack targets.

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

Posted
1 minute ago, diesieben07 said:

And you do that within an entity class, because...?

It's only supposed to happen while the entity is summoned and under certain conditions, all the variables are stored within the class the entity extends, if there's a better way to do do it I would be glad to change it.

It's sad how much time mods spend saying "x is no longer supported on this forum. Please update to a modern version of Minecraft to receive support".

  • Novârch changed the title to [SOLVED] Crash on world.getAllEntities

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.