What you are asking for isn't a simple /fill
, but a system that can generate a cube of stone filled with ores. Imagine the cube just being a bunch of stacked layers that each have been randomly filled with ores.
Summon an armorstand in the bottom corner at the -x -z side of the mine and name it `Layer
/summon ArmorStand x y z {CustomName:Layer,NoGravity:1,Invisible:1,Marker:1}
This will be the pointer of the current layer.
We will also need some armorstands to mark the ores
/execute @e[type=ArmorStand,name=Layer] ~ ~ ~ summon ArmorStand ~ ~ ~ {CustomName:Ore,NoGravity:1,Invisible:1,Marker:1}
You can name some of the armorstands GoldOre
or DiamondOre
ect for diffrent ores (The more armorstands summoned, the more ores per layer)
We will first of all fill the layer with stone. (our mine will be 11*11 in this example)
/execute @e[type=ArmorStand,name=Layer] ~ ~ ~ fill ~ ~ ~ ~10 ~ ~10 stone
now spread the armorstands randomly along the layer
/execute @e[type=ArmorStand,name=Layer] ~ ~ ~ spreadplayers ~5.5 ~5.5 0 5 false @e[type=ArmorStand,r=2,name=!Layer]
make the Ore armorstands place some ores below them (do this for all ore types)
/execute @e[type=ArmorStand,name=Ore] ~ ~ ~ setblock ~ ~-1 ~ coal_ore
Tp The ore armorstands to Layer
/tp @e[type=ArmorStand,name=Ore] @e[type=ArmorStand,name=Layer]
and finally tp Layer
one block up and repeat
/tp @e[type=ArmorStand,name=Layer] ~ ~1 ~
This can be done via the /fill command within /execute.
/execute @a ~ ~ ~ fill ~10 ~10 ~10 ~-10 ~-10 ~-10 pumpkin 0 replace dropper 1
/execute @a ~ ~ ~ fill ~10 ~10 ~10 ~-10 ~-10 ~-10 dropper 1 replace pumpkin 0
You don't have to use a pumpkin, any unused block will do.
Put these two commands separately on a fill clock and run a comparator out from either of the two command blocks with the commands in them. Whenever any player is within 10 blocks (including diagonals, unfortunately) of a dropper with the data value of 1 (was that facing down? I can't remember), the comparator will turn on. Whenever they move out of range, it will turn off. That's currently the closest you can get to what you asked.
Best Answer
First, summon an ArmorStand:
While the floor is still in place, to generate a platform, use
/spreadplayers
to put the ArmorStand in a random location:Replace
X
andZ
with the coordinates of the center of your arena, andD
with the distance from center to edge of the arena:After spreading the
ArmorStand
, have it replace the floor below it with another block type (you can use something like monster egg stone if you want the platforms to look the same as the original floor):You should then be able to replace the original floor block with air (in this example I'm using stone) to have only the platforms still existing: