December 25, 20213 yr Author 1 minute ago, OutCraft said: Do you use the Mojang or MCP mappings? I don't understand what this means
December 25, 20213 yr Just search in your IDE for RenderEvent (Type "RenderEvent" and press Ctrl + Space, then something like EntityRenderEvent should show up) Edited December 25, 20213 yr by OutCraft Sorry if my Posts are weird sometimes, I just try to help and learn as much as I can Also: PLEASE use SPOILERS for logs!
December 25, 20213 yr Author 5 minutes ago, OutCraft said: Just search in your IDE for RenderEvent (Type "RenderEvent" and press Ctrl + Space, then something like EntityRenderEvent should show up) No
December 25, 20213 yr The class is here: net.minecraftforge.client.event.EntityRenderersEvent try @SubscribeEvent public static void registerEntityRenders(net.minecraftforge.client.event.EntityRenderersEvent.RegisterRenderers event) { event.registerEntityRenderer(EntityList.FIRE_CRACKER.get(), ThrownItemRenderer::new); } Sorry if my Posts are weird sometimes, I just try to help and learn as much as I can Also: PLEASE use SPOILERS for logs!
December 25, 20213 yr Author 12 minutes ago, OutCraft said: The class is here: net.minecraftforge.client.event.EntityRenderersEvent try @SubscribeEvent public static void registerEntityRenders(net.minecraftforge.client.event.EntityRenderersEvent.RegisterRenderers event) { event.registerEntityRenderer(EntityList.FIRE_CRACKER.get(), ThrownItemRenderer::new); } not work.Very strange
December 25, 20213 yr Yes, very strange... If you have Discord try going on the official Discord server of Forge, they have a bot that gets the name of a class for each Version (I don't have Discord, so I don't know how this works...) Sorry if my Posts are weird sometimes, I just try to help and learn as much as I can Also: PLEASE use SPOILERS for logs!
December 25, 20213 yr Author 1 minute ago, OutCraft said: Yes, very strange... If you have Discord try going on the official Discord server of Forge, they have a bot that gets the name of a class for each Version (I don't have Discord, so I don't know how this works...) Where is this code in vanilla, let me see
December 25, 20213 yr package net.minecraft.client.renderer.entity.EntityRenderers at the bottom Sorry if my Posts are weird sometimes, I just try to help and learn as much as I can Also: PLEASE use SPOILERS for logs!
December 25, 20213 yr Author 8 minutes ago, OutCraft said: package net.minecraft.client.renderer.entity.EntityRenderers at the bottom you forge version?Detailed version like this: 1.16.5-36.2.2 Edited December 25, 20213 yr by Spring
December 25, 20213 yr I have no Idea Sorry if my Posts are weird sometimes, I just try to help and learn as much as I can Also: PLEASE use SPOILERS for logs!
December 25, 20213 yr Hi! So apparently in 1.16.5 you don't use EntityRenderers and my mod was on 1.17. So you need to update or use SpriteRenderer<>(EntityRendererManager, net.minecraft.client.renderer.ItemRenderer) but I have no Idea how to use this Sorry that I didn't realized this until now Edited December 25, 20213 yr by OutCraft Sorry if my Posts are weird sometimes, I just try to help and learn as much as I can Also: PLEASE use SPOILERS for logs!
December 25, 20213 yr @Override public IPacket<?> getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); } You need to add this into your entity class for the spawning to actually work, if your parent class doesn't have a implementation for this that works. It gets me everytime.
December 26, 20213 yr Author 18 hours ago, LocusAzzurro said: @Override public IPacket<?> getAddEntityPacket() { return NetworkHooks.getEntitySpawningPacket(this); } You need to add this into your entity class for the spawning to actually work, if your parent class doesn't have a implementation for this that works. It gets me everytime. java.lang.NullPointerException: Cannot invoke "net.minecraft.client.renderer.entity.EntityRenderer.shouldRender(net.minecraft.entity.Entity, net.minecraft.client.renderer.culling.ClippingHelper, double, double, double)" because "entityrenderer" is null at net.minecraft.client.renderer.entity.EntityRendererManager.shouldRender(EntityRendererManager.java:238) ~[forge-1.16.5-36.2.2_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.2.2_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.2.2_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.2.2_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.2.2_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.2.2_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.2.2_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {} at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {} at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.2.2_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:108) [forge-1.16.5-36.2.2_mapped_official_1.16.5-recomp.jar:?] {} He broke down
December 26, 20213 yr 1 hour ago, Spring said: java.lang.NullPointerException: Cannot invoke "net.minecraft.client.renderer.entity.EntityRenderer.shouldRender(net.minecraft.entity.Entity, net.minecraft.client.renderer.culling.ClippingHelper, double, double, double)" because "entityrenderer" is null at net.minecraft.client.renderer.entity.EntityRendererManager.shouldRender(EntityRendererManager.java:238) ~[forge-1.16.5-36.2.2_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.2.2_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.2.2_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.2.2_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.2.2_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.2.2_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.2.2_mapped_official_1.16.5-recomp.jar:?] {re:classloading,pl:runtimedistcleaner:A} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?] {} at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?] {} at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?] {} at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?] {} at net.minecraftforge.userdev.FMLUserdevClientLaunchProvider.lambda$launchService$0(FMLUserdevClientLaunchProvider.java:52) ~[forge-1.16.5-36.2.2_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:108) [forge-1.16.5-36.2.2_mapped_official_1.16.5-recomp.jar:?] {} He broke down At least that means you're making some progress, because without the packet the (logical) client won't even know that the entity is spawned so it should render it. And there was no way to know if your renderer/model is done correctly because it never gets to that stage. (What the packet does is notify the client when an entity is spawned to start the rendering.) Now we know from the crash that you have something wrong in your renderer. Here is my checklist that I go thru when making en entity. Make the actual entity class. Make sure it has the spawning packet and data syncing. Register the EntityType for that entity. (In turn make sure the registry itself is registered too. I see you've done it.) Make the Model class for the entity. (Usually extends EntityModel.) Make the Renderer class for the above model and entity. (Usually extends EntityRenderer.) (You can skip these 2 steps if you're using a built-in renderer like the thrown item one as I can see.) Actually register the renderer itself. (During FMLClientSetupEvent call RenderingRegistry.registerEntityRenderingHandler([your EntityType], [a new instance of your Renderer]); (It is fired on the MOD Bus, client side, make sure to handle that as well.) Edited December 26, 20213 yr by LocusAzzurro
December 27, 20213 yr Author 21 hours ago, LocusAzzurro said: At least that means you're making some progress, because without the packet the (logical) client won't even know that the entity is spawned so it should render it. And there was no way to know if your renderer/model is done correctly because it never gets to that stage. (What the packet does is notify the client when an entity is spawned to start the rendering.) Now we know from the crash that you have something wrong in your renderer. Here is my checklist that I go thru when making en entity. Make the actual entity class. Make sure it has the spawning packet and data syncing. Register the EntityType for that entity. (In turn make sure the registry itself is registered too. I see you've done it.) Make the Model class for the entity. (Usually extends EntityModel.) Make the Renderer class for the above model and entity. (Usually extends EntityRenderer.) (You can skip these 2 steps if you're using a built-in renderer like the thrown item one as I can see.) Actually register the renderer itself. (During FMLClientSetupEvent call RenderingRegistry.registerEntityRenderingHandler([your EntityType], [a new instance of your Renderer]); (It is fired on the MOD Bus, client side, make sure to handle that as well.) You are right, he works now
December 27, 20213 yr One thing: When I copied your code and throwed the firecracker, it didn't kill itself when it hit a block, it just went through the block, what it, I suppose, shouldn't do. So don't forget to kill it in the hit block event Sorry if my Posts are weird sometimes, I just try to help and learn as much as I can Also: PLEASE use SPOILERS for logs!
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.