Posted May 19, 20214 yr I get this stacktrace and then crash when joining my world with custom entity: [Render thread/FATAL] [minecraft/Minecraft]: Unreported exception thrown! java.lang.NullPointerException: null at net.minecraft.client.renderer.entity.EntityRendererManager.shouldRender(EntityRendererManager.java:238) ~[forge-1.16.5-36.1.0_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.WorldRenderer.renderLevel(WorldRenderer.java:987) ~[forge-1.16.5-36.1.0_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.GameRenderer.renderLevel(GameRenderer.java:608) ~[forge-1.16.5-36.1.0_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.renderer.GameRenderer.render(GameRenderer.java:425) ~[forge-1.16.5-36.1.0_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.runTick(Minecraft.java:976) ~[forge-1.16.5-36.1.0_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.Minecraft.run(Minecraft.java:607) ~[forge-1.16.5-36.1.0_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:accesstransformer:B,pl:runtimedistcleaner:A} at net.minecraft.client.main.Main.main(Main.java:184) ~[forge-1.16.5-36.1.0_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.8.0_171] {} at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:1.8.0_171] {} at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_171] {} at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_171] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.1.0_mapped_official_1.16.5-recomp.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandlerDecorator.launch(LaunchServiceHandlerDecorator.java:37) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:54) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.LaunchServiceHandler.launch(LaunchServiceHandler.java:72) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.run(Launcher.java:82) [modlauncher-8.0.9.jar:?] {} at cpw.mods.modlauncher.Launcher.main(Launcher.java:66) [modlauncher-8.0.9.jar:?] {} at net.minecraftforge.userdev.LaunchTesting.main(LaunchTesting.java:105) [forge-1.16.5-36.1.0_mapped_official_1.16.5-recomp.jar:?] {} Here are my classes: Entity Class: Renderer Class: Registering Class: Help would be appreciated! Edited May 21, 20214 yr by aritod Solved
May 20, 20214 yr 1. Don't use OnlyIn, properly side off your code. 2. You never register your entity renderer, the static method isn't called anywhere so nothing happens. Register it within FMLClientSetupEvent. 3. Attributes are never registered, same reason. Use the EntityAttributeCreationEvent for this. Edited May 20, 20214 yr by ChampionAsh5357
May 20, 20214 yr Author 10 hours ago, ChampionAsh5357 said: 1. Don't use OnlyIn, properly side off your code. 2. You never register your entity renderer, the static method isn't called anywhere so nothing happens. Register it within FMLClientSetupEvent. 3. Attributes are never registered, same reason. Use the EntityAttributeCreationEvent for this. Hi, sorry that was my old code. I actually did all these things beforehand but it still crashes. My code looks like this: Main Class: Renderer Class:
May 20, 20214 yr Author 3 hours ago, diesieben07 said: FMLClientSetupEvent fires on the mod event bus, you subscribed to the forge event bus. How do i subscribe to the mod event bus
May 20, 20214 yr Author 33 minutes ago, diesieben07 said: Look at the parameters for the EventBusSubscriber annotation. The parameter 'bus' in EventBusSubscriber is using Mod.EventBusSubscriber.Bus.MOD which is the mod event bus so I'm not sure why it is using the forge event bus. The parameter 'value' does not seem to be related but I added it as a parameter because it says that it is only necessary if it is not on the same class that has a @Mod annotation. It still crashes so I'm not really sure what I should be looking for. This is my code:
May 20, 20214 yr Please link a paste of the EntityType object initialization, where the associated register is attached to the event bus, the renderer, where the renderer is registered, and where the attributes are registered. I know you might have already sent them, but I would like full context rather than pictures of partial snippets. Also, you shouldn't be passing in a new instance of the Reloadable resource manager. Grab the one within the Minecraft instance and pass that in.
May 20, 20214 yr Author 27 minutes ago, ChampionAsh5357 said: Please link a paste of the EntityType object initialization, where the associated register is attached to the event bus, the renderer, where the renderer is registered, and where the attributes are registered. I know you might have already sent them, but I would like full context rather than pictures of partial snippets. Also, you shouldn't be passing in a new instance of the Reloadable resource manager. Grab the one within the Minecraft instance and pass that in. https://paste.gemwire.uk/view/98040c70
May 20, 20214 yr 1. The RegistryEvents class needs to have the mod id in the annotation. 2. Your entity texture is doing nothing in the RenderFakeWither class, override #getTextureLocation and supply.
May 20, 20214 yr Author 38 minutes ago, ChampionAsh5357 said: 1. The RegistryEvents class needs to have the mod id in the annotation. 2. Your entity texture is doing nothing in the RenderFakeWither class, override #getTextureLocation and supply. Hi I did these 2 things but it still crashes: https://paste.gemwire.uk/view/a41ce426 Edited May 20, 20214 yr by aritod
May 20, 20214 yr Is the error still the same? If so, could you put breakpoints within the client setup event where you register the renderer and attribute creation to make sure both events do run and call their methods?
May 21, 20214 yr Author 1 hour ago, ChampionAsh5357 said: Is the error still the same? If so, could you put breakpoints within the client setup event where you register the renderer and attribute creation to make sure both events do run and call their methods? The error is still the same and both ClientSetupEvent and EntityAttributeCreationEvent are called after checking through debug mode.
May 21, 20214 yr Can you provide a paste of the entire debug log? I don't see anything wrong with the code currently. Also, could you provide the entity class? Edited May 21, 20214 yr by ChampionAsh5357
May 21, 20214 yr Author 12 hours ago, ChampionAsh5357 said: Can you provide a paste of the entire debug log? I don't see anything wrong with the code currently. Also, could you provide the entity class? Where is the debugger log? Also here is my entity class: https://paste.gemwire.uk/view/3fe1958b
May 21, 20214 yr Author 1 hour ago, ChampionAsh5357 said: Within runs/logs/debug.log https://paste.gemwire.uk/view/101f4689
May 21, 20214 yr There's nothing that suggests the error is outside of #shouldRender meaning that the entity renderer might be null somehow. However, there is nothing that suggests an error can occur there with the snippets. Would you mind posting a link to your repository on Github, Gitlab, etc.? I'm going to build a local workspace and see if I can't debug it.
May 21, 20214 yr Author 1 hour ago, ChampionAsh5357 said: There's nothing that suggests the error is outside of #shouldRender meaning that the entity renderer might be null somehow. However, there is nothing that suggests an error can occur there with the snippets. Would you mind posting a link to your repository on Github, Gitlab, etc.? I'm going to build a local workspace and see if I can't debug it. https://github.com/ForgeModDev/LogFixer/tree/master
May 21, 20214 yr Found the error, and its annoying. The resource location being passed into the rendering handler has the modid written twice, once in the namespace and once in the path. The path does not accept colons, so an error was thrown which was eaten by the lambda and discarded. All you need to do is remove the modid and the colon from the path of the resource location in ModRenderers.
May 21, 20214 yr Author 1 hour ago, ChampionAsh5357 said: Found the error, and its annoying. The resource location being passed into the rendering handler has the modid written twice, once in the namespace and once in the path. The path does not accept colons, so an error was thrown which was eaten by the lambda and discarded. All you need to do is remove the modid and the colon from the path of the resource location in ModRenderers. Thank you so much! Can't believe something as little as that was the cause of this. Now I can finally continue working on my mod. Thanks to everyone who helped
May 22, 20214 yr This is my first time posting on this forum, so I don't know If I should make a completely new post for this, but I am having trouble with a similar thing. EntityRenderManager.shouldRender is throwing a NullPointerException, but the decription is "Unexpected Error". I tried doing what OP did but it didn't fix anything. I have seperate classes for the Renderers though and it might have something to do with that. Can I just post my code here or should I create a new topic as mentioned? (Dont wanna upset anyone)
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.