Skip to content

BlockReplacement

A BlockReplacement is a record of two materials. The first material points to what it should become. This component is only used when working with the PacketHandler. A BlockReplacement makes a specific block type appear as another block without changing it on the server.

public class ExampleClass {
public boolean exampleUsage(@NotNull CustomBiome customBiome) {
// Makes all grass blocks appear as diamond blocks in the biome
BlockReplacement blockReplacement = BlockReplacement.of(Material.GRASS_BLOCK, Material.DIAMOND_BLOCK);
// Let's add it to our custom biome
customBiome.setBlockReplacements(blockReplacement);
}
}