Jump to content

[1.15.2] Disabling Clouds


Callan2256

Recommended Posts

Hey guys,

 

Pretty simple question, im trying to get the game to disable clouds when you enter a desert biome, I have the first half of that equation sorted but cant quite figure out how to disable the clouds (If its even possible!)

Im new to forge and the complete lack of comprehensive documentation isn't a great help haha.

Any help appreciated! Cheers

Edited by Callan2256
Link to comment
Share on other sites

Managed to get it working.

Code posted below should anyone come across this issue in the future, please note that the code is janky as hell as a result with how unfamiliar I am with forge. (So if you have any recommendations on where I can improve it feel free to let me know)

 

    @SubscribeEvent
    public void cloudRemover(TickEvent.PlayerTickEvent event) {
        PlayerEntity p = event.player;

        Biome biome = p.world.func_226691_t_(p.getPosition());
        String biomeName = biome.getTranslationKey();

        GameSettings settings = Minecraft.getInstance().gameSettings;

        if (biomeName.contains("desert")) {
            settings.cloudOption = CloudOption.OFF;
        } else {
            settings.cloudOption = CloudOption.FANCY;
        }
    }

 

 

Link to comment
Share on other sites

19 minutes ago, Callan2256 said:

(So if you have any recommendations on where I can improve it feel free to let me know)

If you aren't already you need to make sure your event only runs on the client, because otherwise that will crash the dedicated server.

VANILLA MINECRAFT CLASSES ARE THE BEST RESOURCES WHEN MODDING

I will be posting 1.15.2 modding tutorials on this channel. If you want to be notified of it do the normal YouTube stuff like subscribing, ect.

Forge and vanilla BlockState generator.

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.