May 11, 20196 yr Author Did you mean Show or Whow? Heres my code: Spoiler @SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true) public static void onFogDensityEvent(EntityViewRenderEvent.FogDensity event) { if (event.getEntity().isInsideOfMaterial(ModMaterials.MOLTEN_GLASS)) { GlStateManager.setFog(EXP); event.setDensity(2F); } else { GlStateManager.setFog(LINEAR); event.setDensity(0.01F); } } @SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true) public static void onFogColorsEvent(EntityViewRenderEvent.FogColors event) { if (event.getEntity().isInsideOfMaterial(ModMaterials.MOLTEN_GLASS)) { event.setRed(COLOR_MOLTEN_GLASS.getRed() / 255F); event.setGreen(COLOR_MOLTEN_GLASS.getGreen() / 255F); event.setBlue(COLOR_MOLTEN_GLASS.getBlue() / 255F); } }
May 11, 20196 yr I meant show, sorry. Read the docs on the FogDensity event: /** * Event that allows any feature to customize the fog density the player sees. * NOTE: In order to make this event have an effect, you must cancel the event */
May 11, 20196 yr Author Oops i accidently removed that while adjusting. Now when i get out of the fluid i cant see anything. I already set the fog density to be small when not in the liquid. Spoiler Spoiler @SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true) public static void onFogDensityEvent(EntityViewRenderEvent.FogDensity event) { if (event.getEntity().isInsideOfMaterial(ModMaterials.MOLTEN_GLASS)) { GlStateManager.setFog(EXP); event.setDensity(2F); } else { GlStateManager.setFog(LINEAR); event.setDensity(0.01F); } event.setCanceled(true); } @SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true) public static void onFogColorsEvent(EntityViewRenderEvent.FogColors event) { if (event.getEntity().isInsideOfMaterial(ModMaterials.MOLTEN_GLASS)) { event.setRed(COLOR_MOLTEN_GLASS.getRed() / 255F); event.setGreen(COLOR_MOLTEN_GLASS.getGreen() / 255F); event.setBlue(COLOR_MOLTEN_GLASS.getBlue() / 255F); } }
May 11, 20196 yr ...Only cancel the event when you are actually in liquid? Let vanilla take it's course when you are not in it.
May 12, 20196 yr Author Worked thanks! Btw is there a way to disable the animation on the fluid when its in the bucket?
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.