Not sure how to handle chunking

Hello
I am currently working in Libgdx and making a 3D top down game
I have made 1 chunk, however I am not sure how to handle multiple chunks

I want the system to work like this, I have 9 meshes (top left, top,top right,etc etc) I only want 9 chunks in the game at one given time, every time the player moves out of the chunk range it will generate and allocate a new chunk and deallocate a not visible chunk meaning It will only need 9 meshes (9 draw calls)

I am just not sure how to handle this… can someone explain the ways for me, there is no up or down its just like a 2D game I am only using X and Z

This is the world code

package com.hawk.green.world;

import com.badlogic.gdx.graphics.Camera;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.Mesh;
import com.badlogic.gdx.graphics.glutils.ShaderProgram;
import com.badlogic.gdx.utils.Disposable;
import com.hawk.green.Art;

public class World implements Disposable {

	static final short MAX_CHUNKS = 9;
	
	private Mesh[] chunkMeshes = new Mesh[MAX_CHUNKS];
	private Chunk[] chunks = new Chunk[MAX_CHUNKS];

	private Camera camera;
	private ShaderProgram shader;
	
	

	public World(Camera camera) {
		this.camera = camera;
		shader = Art.getInstance().getShaderProgram();
		
		for(int i = 0;i < MAX_CHUNKS;++i){
			chunkMeshes[i] = ChunkMeshBuilder.createEmptyChunkMesh();
		}
	}

	public void render() {
		shader.begin();
		shader.setUniformMatrix("u_projTrans", camera.combined);
		for(int i = 0;i < MAX_CHUNKS;++i)
		chunkMeshes[i].render(Art.getInstance().getShaderProgram(), GL20.GL_TRIANGLES);
		shader.end();
	}

	@Override
	public void dispose() {
		for(int i = 0;i < MAX_CHUNKS;++i)
		chunkMeshes[i].dispose();

	}

}

This is my chunk code

public class Chunk {

	public final static int CHUNK_SIZE = 32;
	public final static int WORLD_HEIGHT = 2;

	private short[][][] blocks = new short[CHUNK_SIZE][WORLD_HEIGHT][CHUNK_SIZE];
	
	private Vector2 position;

	public Chunk(float x,float z) {
		position = new Vector2(x, z);
	}

	void reset() {
		for (int x = 0; x < CHUNK_SIZE; ++x) {
			for (int y = 0; y < WORLD_HEIGHT; ++y) {
				for (int z = 0; z < CHUNK_SIZE; ++z) {
					blocks[x][y][z] = 0;
				}
			}

		}
	}
	
	public Vector2 getPosition() {
		return position;
	}

}

Can someone at least give me some hints, I’m kinda going for a huge map but not sure how to handle the data

So far I have 9 chunks rendering (9 meshes) I don’t want to add anymore meshes I want to recreate them when i move around

If you are generating the whole map at once you can hold the chunk data in a file / database etc, using the players position you work out which chunks currently need loading / disposing.

You currently have 9 chunks loaded so which ever one the player moves to next its already loaded, when a player moves into one of those chunks you need to load the chunks that are not yet loaded (its neighbours). If you decide to randomly generate chunks then you would generate and save them rather than just loading them.

Will you be generating the full world before the player starts?

I kinda wanted to handle a large map, but I have kinda sorted it using a smaller map but im using 81 chunks (meshes) but obviously not rendering them all at once

I wanted to see if i could make a unlimited world as i have no idea, sample code would be great