Posted June 27, 20196 yr I've found the method ItemRenderer#renderFireInFirstPerson() and using reflection I can use it, but the fire is not actually shown on the screen. Should I use a different way to render the fire? This is what I have done so far: private static Minecraft minecraft = Minecraft.getMinecraft(); private static Method renderFire1st = ObfuscationReflectionHelper.findMethod(minecraft.getItemRenderer().getClass(), "func_78442_d", void.class); @SubscribeEvent public static void renderEffect(RenderLivingEvent.Post event) { try { if (!net.minecraftforge.event.ForgeEventFactory.renderFireOverlay(minecraft.player, event.getPartialRenderTick())) renderFire1st.invoke(minecraft.getItemRenderer()); } catch (IllegalAccessException | InvocationTargetException e) { System.out.println("Forge was not present."); } } Thank you in advance!
June 28, 20196 yr Author Okay, I've tried various things, and the only thing I got to work was the following: private static Minecraft minecraft = Minecraft.getMinecraft(); private static Method renderFire1st = ObfuscationReflectionHelper.findMethod(ItemRenderer.class, "func_78442_d", void.class); @SubscribeEvent public static void renderFirstPersonEffect(RenderHandEvent event) { if(minecraft.gameSettings.thirdPersonView == 0) { if (!net.minecraftforge.event.ForgeEventFactory.renderFireOverlay(minecraft.player, event.getPartialTicks())) { try { renderFire1st.invoke(minecraft.getItemRenderer()); } catch (IllegalAccessException | InvocationTargetException e) { e.printStackTrace(); } } } } But this seems like a hacky solution, and I would like to know if I should use an alternative way to do this. Maybe another event to subscribe to.
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.