Skip to content

Updating Biomes

The BiomeUpdater is an interface for updating biomes in real-time without the need for players to relog or for chunks to be reloaded.

The biome updater works by re-sending the chunk packets to players with the updated biome data.

ExampleListener.java Java
import me.outspending.biomesapi.renderer.updater.BiomeUpdater;
import org.bukkit.Chunk;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.BlockBreakEvent;

public class ExampleListener implements Listener {

  private static final BiomeUpdater BIOME_UPDATER = BiomeUpdater.of();

  @EventHandler
  public void onBlockBreak(BlockBreakEvent event) {
      Chunk chunk = event.getBlock().getChunk();
      // Update the biome of the chunk
      BIOME_UPDATER.updateChunk(chunk);
  }
}