-
Notifications
You must be signed in to change notification settings - Fork 0
Creating a fog
Olafcio1 edited this page Jul 24, 2026
·
3 revisions
This guide assumes you've already created and setup an Avoid project.
This guide uses meta-programming. Another way may either not be implemented or you may need to figure it out on your own.
§ Making a fog with the Avoid Framework
-
Create a java class;
You can pick any location within your project source code directory. -
Paste the following code:
package com.example.avoidtmpl.fluid; import pl.olafcio.avoid.mods.annotation_processor.AutoFog; import pl.olafcio.avoid.net.entity.Entity; import pl.olafcio.avoid.net.fog.Fog; import pl.olafcio.avoid.net.fog.FogState; import pl.olafcio.avoid.net.fog.delta.TickTracker; import pl.olafcio.avoid.net.id.Identification; import pl.olafcio.avoid.net.world.World; @AutoFog public class OilFog extends Fog { @Override public void createFog(FogState fog, Entity entity, World world, float blockDistance, TickTracker tickTracker) { // customize this method to be like you want your fog to be. fog.skyEnd=6.0f; fog.cloudEnd=6.0f; fog.environmentalStart=3.25f; fog.environmentalEnd=6.0f; } @Override public boolean shouldApply(Identification fogType, Entity entity) { return fogType.is("testmod", "oil"); // replace this to contain the appropriate values for your fluid. // if you don't want this fog to be a for a fluid, you can also inspect the entity; // or you can check for a non-fluid fogType (e.g. a minecraft one, or a neoforge one from a mod that adds some. although having dependencies that don't use the avoid framework is a mid idea, if you need to do it, do it) } @Override public int baseColor(World world, Entity entity, int renderDistance, float deltaTicks) { return 0x000000; // replace this with your fog color. the format is HEX (rgb in hexadecimals). you can also use new Color(...).getRGB() } }
Of course you need to replace the class name and package.
-
Follow the comments;
Change the behaviour like you want your fog to have.
©️ Copyright 2026 Olafcio (on behalf of the AvoidLib org)
📝 Licensed with CC BY-NC (Attribution-NonCommercial)