Posted April 24, 20205 yr 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".
April 24, 20205 yr 14 minutes ago, Novârch said: and the debug.log: https://gist.github.com/Novarch129/38e8edc698dcafd745e05e7bb04d7d7e That log looks like it ends prematurely *edit: also, are you sure that this code is only running on the client? Minecraft is a client-only class I do believe. I would set breakpoints and walk through the code to see what is happening. Edited April 24, 20205 yr by Ugdhar
April 24, 20205 yr Author 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".
April 24, 20205 yr Author 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".
April 24, 20205 yr Author 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".
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.