Using the BiomeSetter
The BiomeSetter is the most straightforward way to set biomes in your world.
It directly modifies the biome of a chunk on the server, which means that the biome change is not just visual, but also affects gameplay elements such as mob spawns, weather, and more.
When to use the BiomeSetter
Section titled “When to use the BiomeSetter”- You want to change the biome of a chunk for all players in the same way.
- You want to change gameplay elements of the biome such as mob spawns.
Example Usage
Section titled “Example Usage”import me.outspending.biomesapi.biome.CustomBiome;
import me.outspending.biomesapi.renderer.setter.BiomeSetter;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.world.ChunkLoadEvent;
public class ExampleListener implements Listener {
private static final BiomeSetter BIOME_SETTER = BiomeSetter.of();
@EventHandler
public void onChunkLoad(ChunkLoadEvent event) {
// Store a reference to your biome or use the BiomeHandler
CustomBiome biome = ...;
BIOME_SETTER.setChunkBiome(event.getChunk(), biome);
}
}