PaperMC / PaperMC/Paper

Expose `net.minecraft.world.level.biome.Biome.hasPrecipitation()` in paper Biome API.

Open
#13,487 0 comments 0 reactions 0 assignees View on GitHub

@masmc05 is already working on this.

Since Jan 12, 2025.

status: accepted
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Is your feature request related to a problem?

I'm trying to get rid of NMS code from a plugin since Paper API now support custom biomes & custom biome tags.
I haven't found a way to know if there is snow or rain in a biome with the API. I know we can know if the world hasStorm, but I would like to know if a specific biome is wet enough to be rainy.

This is what I'm currently using

  private static double getWeatherTemperatureModifier(Location location) {
        if (!NMSBiomeUtils.getBiome(location).hasPrecipitation()) { // access NMS biome
            return 0.0;
        } else if (location.getWorld().isThundering()) {
            return 0.1;
        } else if (location.getWorld().hasStorm()) {
            return 0.2;
        } else {
            return 0.0;
        }
    }
Describe the solution you'd like.

I would love to have a org.bukkit.block.Biome.hasPrecipitation() function that works as the vanilla one:

  • return true if the biome .json file contains "has_precipitation": true.
  • else return false.

An access to Biome.Precipitation getPrecipitationAt(BlockPos pos, int seaLevel) would probably usefull to some people to.

Describe alternatives you've considered.

I've tried to get the precipitation from somewhere else in the Paper API, but it doesn't look like to have a hasPrecipitation() function anywhere.

Other

Thanks for all the new API stuff about biomes.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the org.bukkit.block.Biome API and linked pull request #11952 to see where this feature is already being implemented. Done means the API exposes hasPrecipitation() with the requested vanilla behavior for custom and existing biomes.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.