I don’t have a code snippet, but something you could try, is instead of it loading in tons of blocks when you get to a certain point on the already loaded blocks, you could have the code basically have a field of loaded and unloaded blocks around the player.
Basically, as they move in one direction, the blocks in front of them will spawn in as they get closer, and the blocks behind them will despawn. So let’s say a chunk in your game is 64 x 64 blocks. Now, instead of going to the end of the chunk you are in and it spawns a whole new chunk, the game will spawn in a new singular column of blocks when the character moves one block closer. So instead of having chunks spawn, you only ever have a chunk loaded. And that chunk is based around the player, not where the server considers the chunk to be.
It wont the server will have all of the data for where the blocks are instead of sending the whole data table only send the data of a specific bound the player is in. That way minor data is being transferred at a time.
Example would be get the bounds as to how far the player can see and only load the top layer in, also send the data of the blocks below the player so if they dig that will load in. you can have any player built data loaded in all the time if they are in the chunk it was built. to save even more data for the player you can have it so if the player built 4 of the exact same block connected to each other, instead of those being 4 separate blocks make it one block the size the 4 blocks would be with a tiled texture.
That same idea can be replicated for the world too, just make it so the blocks within a certain radius of the player are single blocks so the player can dig them up. its a behind the scene trick that game developers do and the player will be none the wiser