Sueta

BiomesAPI - Custom Biomes

0.0.5

Create Custom Biomes in Spigot / PaperMC!

·Plugin

upload_2024-1-11_23-29-58.png

Hello There,

I've recently made an API for custom biomes for SpigotMC. This API is pretty useful for builders / developers to improve their server.

I am working on this everyday and listening to suggestions.

Here's a little snippet of how to create / set a CustomBiome inside BiomesAPI:

public final class Example extends JavaPlugin implements Listener {

    @Override
    public void onEnable() {
        getServer().getPluginManager().registerEvents(this, this);

        CustomBiome biome = CustomBiome.builder()
                .resourceKey(BiomeResourceKey.of("test", "custombiome"))
                .settings(BiomeSettings.defaultSettings())
                .fogColor("#db4929")
                .foliageColor("#22c1c8")
                .skyColor("#c8227d")
                .waterColor("#c82222")
                .waterFogColor("#b9de2e")
                .grassColor("#40df8b")
                .build();

        biome.register();
    }

    @EventHandler
    public void onBlockBreak(BlockBreakEvent e) {
        CustomBiome biome = BiomeHandler.getBiome(BiomeResourceKey.of("test", "custombiome"));
        if (biome == null) return;

        Location loc = e.getPlayer().getLocation();;
        Location loc1 = loc.clone().add(100, 50, 100);
        Location loc2 = loc.clone().add(-100, -50, -100);

        BiomeSetter.of().setRegionBiome(loc1, loc2, biome, true);
    }
}

Here's some images of the API:

Images

Similar projects

Plugin →