Skip to content

ChunkLocation

A ChunkLocation simply represents a specific chunk’s x and z coordinates.

public class ExampleClass {
public boolean exampleUsage(@NotNull Block block) {
// Get the chunk at 0, 0
ChunkLocation chunkLocation = ChunkLocation.of(0, 0);
ChunkLocation chunkLocation2 = ChunkLocation.fromBlockCoords(block.getX(), block.getZ());
// Check if the second chunk location is within a 4 chunk radius of the first one
return chunkLocation.isWithinRadius(chunkLocation2, 4);
}
}