Skip to content

Creating Custom Biomes

CustomBiomes are the core of BiomesAPI and are used to create biomes that can be rendered to players using the various biome renderers in BiomesAPI.

We provide many different options for customizing your biome visuals and gameplay elements through our builder, but you may also omit any of these attributes if you want to use the default underlying biome’s values.

Java
import me.outspending.biomesapi.biome.CustomBiome;
import me.outspending.biomesapi.registry.ResourceKey;
import me.outspending.biomesapi.wrapper.BiomeSettings;
import org.bukkit.plugin.java.JavaPlugin;

public class ExamplePlugin extends JavaPlugin {
  @Override
  public void onEnable() {
      CustomBiome customBiome = CustomBiome.builder()
          .resourceKey(ResourceKey.of("test", "custombiome"))
          .settings(BiomeSettings.defaultSettings())
          .fogColor("#FFFFFF")
          .foliageColor("#F5F2EB")
          .skyColor("#B99DFC")
          .waterColor("#F5F2EB")
          .waterFogColor("#000000")
          //.grassColor("#DBE9EC") // Want to use the default underlying color? Omit it!
          .build();

          // All done? Register it!
          customBiome.register();
  }
}

BiomesAPI supports modifying existing biomes after they’ve been registered. This means that you can change the visuals and gameplay elements of your biome on the fly. To apply your changes, you must call the modify() method on your biome, which will update the registry.

For players to see your changes they will either need to relog or you can use the RegistryReconfigurer to resend the biome data to players without them needing to relog.

ExamplePlugin.java Java
import me.outspending.biomesapi.biome.CustomBiome;
import me.outspending.biomesapi.registry.ResourceKey;
import me.outspending.biomesapi.wrapper.BiomeSettings;
import org.bukkit.plugin.java.JavaPlugin;

public class ExamplePlugin extends JavaPlugin {
  @Override
  public void onEnable() {
      CustomBiome customBiome = CustomBiome.builder()
          .resourceKey(ResourceKey.of("test", "custombiome"))
          .settings(BiomeSettings.defaultSettings())
          .fogColor("#FFFFFF")
          .foliageColor("#F5F2EB")
          .skyColor("#B99DFC")
          .waterColor("#F5F2EB")
          .waterFogColor("#000000")
          .register();

      // Don't like it later? Change it!
      customBiome.setFoliageColor("#00FF00");
      customBiome.modify();
  }
}