Voxel chunks?

I Have made a simple voxel engine. I Have made it so that if you type

createChunk(xPosisitonInWorld, yPositionInWorld);

It will create a 16x16 chunk at that world point. The problem I have is trying to figure out how to make it render around the player, any ideas. I Got something but its not worth showing. It was really bad. Thanks in advance! :smiley:

The best way to generate around the player is to build a small system what loads chunks around the object, every frame it could check every chunks local position, and see if they are far enough away from the object to safely unload and save them, you can then in the same system load the new chunks by adding a " row " on the opposite end of the loaded area. Having a system like this allows for multiple areaโ€™s of chunks to be loaded at the same time.