Unless you can find a mod that does that or a modder willing to write one (or are willing to settle for a superflat world) the best I can think of would be a string of command blocks in the spawn chunks repeatedly running /fill around the players position.
Assuming you want a player to be able to dig through the layer you can't replace air with your block so I think you'd need one command for, at least, each type of stone and if you want a solid layer each type of ore as well. (You'd still get holes where caves intersect your layer.)
If you are ok with doing this for a limited area you could fly around the world filling in the layer first and then disable the command blocks.
Actually in that case you could settle for one command block making a totally solid layer.
If you are going to play the world yourself and don't want hints on where to find things you could fly around under the bedrock floor, without a map it might be hard to be certain you hadn't missed anyplace though it could be done by following the coordinates on the debug screen.
Do you mind explaining the purpose?
I'm particularly curious about why you want it added after world generation, any existing mod that added something like this would probably do it in world generation.
--
If the commands are going to be running constantly you might want to use a redstone clock to run the command blocks once every second or two instead of multiple times per second, like the auto repeat function does, in order to cut down on lag.
I've come up with something that I think would work better, based on what I think you want.
There may well be a better way, perhaps using execute...if block(s) but I'm no good with commands, this is a bit of a kludge but I think it would work.
I probably won't have time to work through it and get it working properly, this is just the general idea.
The idea is to have a grid of 9 boxes around the player and a string of 16 command blocks in the spawn chunks, 2 for each of the outer boxes.
First an unconditional command block that uses fill to replace the bottom layer of bedrock in that box with obsidian (or air or whatever), if it finds any bedrock the command succeeds and the next, conditional command block replaces all blocks in that box at your chosen level with your chosen block, then the next, unconditional command block tests the next box followed by a conditional command block to fill in your block, and so on for the rest of the outer boxes.
This should create a solid unbroken layer of your block (except for where the player is standing when you start this, which would require a separate one time command) but won't replace broken blocks in any area the player has visited, just extending the layer when the player gets close to somewhere they haven't been before.
You might want the boxes to overlap a bit to make sure no area is missed.
--
Oh, and teleporting players and players returning through new portals in the Nether might also end up with no layer at their position.
Fill doesn't work as it has a block limit. I need the whole layer, and I need it to be a command I can use after the world is loaded. Please help
The world is 60 million blocks in width, it would take you ages to do this with commands (if it's even possible). If you are generating a flat world, you can use the built-in generation options. If you want a normal world, you could try third party software like WorldPainter and create an area with a custom layer.
Well to answer the one question I'm trying to make a bioshock challenge. Generate an amplified world and then replace the type layer with water. Thanks for the replies. I will give all these ideas a try how would I make the replace water command follow the player though?
execute at @p run fill ~-16 70 ~-16 ~16 70 ~16 minecraft:water
for instance.
You can fill up to 64 blocks all around the player but that's pretty slow and laggy.
Is "type" a typo for top?
As in up at Y = 256 ?
That could be a problem, it would take a while for the water to flow all the way down to the deepest ravines, giving the player the chance to outrun the water.
I think you're going to have to pregenerate the world, which you apparently don't want to do.
I suppose you want to have the player run around in a normal world to prepare for the deluge?
I'd suggest having 2 areas, say 10,000 blocks apart and teleporting the player to the waterworld when it's time.
-------
If you use 1.12 or earlier the Customized world type allowed one to change the sea level, you couldn't use Amplified but there were settings for world height and stuff, perhaps use the Mountain Madness preset and just change the sea level.
That would require you to remove the water from an area to make a pre deluge area.
------
You might want to look into World Edit or something for adding or removing water, I expect you'd still need two areas but I don't know much about it.
Or see if somebody has written a mod that would be useful.
Fill doesn't work as it has a block limit. I need the whole layer, and I need it to be a command I can use after the world is loaded. Please help
Unless you can find a mod that does that or a modder willing to write one (or are willing to settle for a superflat world) the best I can think of would be a string of command blocks in the spawn chunks repeatedly running /fill around the players position.
Assuming you want a player to be able to dig through the layer you can't replace air with your block so I think you'd need one command for, at least, each type of stone and if you want a solid layer each type of ore as well. (You'd still get holes where caves intersect your layer.)
If you are ok with doing this for a limited area you could fly around the world filling in the layer first and then disable the command blocks.
Actually in that case you could settle for one command block making a totally solid layer.
If you are going to play the world yourself and don't want hints on where to find things you could fly around under the bedrock floor, without a map it might be hard to be certain you hadn't missed anyplace though it could be done by following the coordinates on the debug screen.
Do you mind explaining the purpose?
I'm particularly curious about why you want it added after world generation, any existing mod that added something like this would probably do it in world generation.
--
If the commands are going to be running constantly you might want to use a redstone clock to run the command blocks once every second or two instead of multiple times per second, like the auto repeat function does, in order to cut down on lag.
Just testing.
I've come up with something that I think would work better, based on what I think you want.
There may well be a better way, perhaps using execute...if block(s) but I'm no good with commands, this is a bit of a kludge but I think it would work.
I probably won't have time to work through it and get it working properly, this is just the general idea.
The idea is to have a grid of 9 boxes around the player and a string of 16 command blocks in the spawn chunks, 2 for each of the outer boxes.
First an unconditional command block that uses fill to replace the bottom layer of bedrock in that box with obsidian (or air or whatever), if it finds any bedrock the command succeeds and the next, conditional command block replaces all blocks in that box at your chosen level with your chosen block, then the next, unconditional command block tests the next box followed by a conditional command block to fill in your block, and so on for the rest of the outer boxes.
This should create a solid unbroken layer of your block (except for where the player is standing when you start this, which would require a separate one time command) but won't replace broken blocks in any area the player has visited, just extending the layer when the player gets close to somewhere they haven't been before.
You might want the boxes to overlap a bit to make sure no area is missed.
--
Oh, and teleporting players and players returning through new portals in the Nether might also end up with no layer at their position.
Just testing.
The world is 60 million blocks in width, it would take you ages to do this with commands (if it's even possible). If you are generating a flat world, you can use the built-in generation options. If you want a normal world, you could try third party software like WorldPainter and create an area with a custom layer.
Command block engineer // Developer // #TeamTrees
Well to answer the one question I'm trying to make a bioshock challenge. Generate an amplified world and then replace the type layer with water. Thanks for the replies. I will give all these ideas a try how would I make the replace water command follow the player though?
execute at @p run fill ~-16 70 ~-16 ~16 70 ~16 minecraft:water
for instance.
You can fill up to 64 blocks all around the player but that's pretty slow and laggy.
Is "type" a typo for top?
As in up at Y = 256 ?
That could be a problem, it would take a while for the water to flow all the way down to the deepest ravines, giving the player the chance to outrun the water.
I think you're going to have to pregenerate the world, which you apparently don't want to do.
I suppose you want to have the player run around in a normal world to prepare for the deluge?
I'd suggest having 2 areas, say 10,000 blocks apart and teleporting the player to the waterworld when it's time.
-------
If you use 1.12 or earlier the Customized world type allowed one to change the sea level, you couldn't use Amplified but there were settings for world height and stuff, perhaps use the Mountain Madness preset and just change the sea level.
That would require you to remove the water from an area to make a pre deluge area.
------
You might want to look into World Edit or something for adding or removing water, I expect you'd still need two areas but I don't know much about it.
Or see if somebody has written a mod that would be useful.
Just testing.