Hi, I'm new to WorldGen modding and I'm trying to understand how the Event system works.
The issue I’m running into is that the ChunkColumnGenerationRequest values for ChunkX and ChunkZ are always very far away, and never close to the player or the spawn.
A sample of my console:
4.9.2025 15:36:33 [Server Notification] [testmod] place block at 511664, 120, 511920
4.9.2025 15:36:33 [Server Notification] [testmod] place block at 511664, 120, 512112
4.9.2025 15:36:33 [Server Notification] [testmod] place block at 511920, 120, 511728
4.9.2025 15:36:33 [Server Notification] [testmod] place block at 511952, 120, 511728
4.9.2025 15:36:33 [Server Notification] [testmod] place block at 511984, 120, 511728
4.9.2025 15:36:33 [Server Notification] [testmod] place block at 511792, 120, 512304
Here a snippet of my code:
public override void StartServerSide(ICoreServerAPI api)
{
api.Event.ChunkColumnGeneration(OnCaveGeneration, EnumWorldGenPass.Terrain, "standard");
}
private void OnCaveGeneration(IChunkColumnGenerateRequest request)
{
Block blockType = _api.World.GetBlock(new AssetLocation("game:rock-granite"));
BlockPos blockPos = new BlockPos(
request.ChunkX * GlobalConstants.ChunkSize + GlobalConstants.ChunkSize / 2,
120,
request.ChunkZ * GlobalConstants.ChunkSize + GlobalConstants.ChunkSize / 2
);
bool isPlaced = blockType.TryPlaceBlockForWorldGen(_chunkGenBlockAccessor, blockPos, BlockFacing.UP, null);
if(isPlaced)
Mod.Logger.Notification($"place block at {blockPos}");
}
If you need anything else to help, tell me.