I'm making a disco minigame, and when I /fill make the floor drop out, there needs to be platforms in random places for the player to jump on, and be saved. How do I do this? (if there is a way to do this with command blocks, then that is recomended. I kinda need to do it with command blocks)

  • Will the platforms be at the same height as the floor that drops out, or below it?
    – SirBenet
    Feb 22, 2016 at 17:32
  • I would like them to be at the same height, but if they are below, I can totally work with that.
    – Kylun11
    Feb 22, 2016 at 17:43

3 Answers 3


First, summon an ArmorStand:

/summon ArmorStand ~ ~ ~ {Marker:1,Invisible:1,NoGravity:1,Invulnerable:1,CustomName:"Platformer"}

While the floor is still in place, to generate a platform, use /spreadplayers to put the ArmorStand in a random location:

/spreadplayers X Z 0 D false @e[name=Platformer,type=ArmorStand]

Replace X and Z with the coordinates of the center of your arena, and D with the distance from center to edge of the arena:

Diagram showing the values of X, Z and D

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):

/execute @e[type=ArmorStand,name=Platformer] ~ ~ ~ /fill ~1 ~-1 ~1 ~-1 ~-1 ~-1 cobblestone 0 replace stone

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:

/fill X1 Y1 Z1 X2 Y2 Z2 air 0 replace stone
  • That's a really creative use of /spreadplayers! Upvote. Feb 25, 2016 at 23:52

You could teleport invisible armor stands and do /fill X Y Z X2 Y2 Z2 -block of floor-

/execute @e[type=ArmorStand] ~ ~ ~ /fill ~-1 ~ ~-1 ~1 ~ ~1 -block of platform-

/fill X Y Z X2 Y2 Z2 air 0 replace -block of floor- 0
  • While this explains how to make platforms, the bigger question is how to randomly distribute them.
    – MrLemon
    Feb 22, 2016 at 17:18

I would summon armor stands in every block with [nogravity:1,invisible:1,invulnerable:1,CustomName:"Anything"] and then do execute @e ~ ~ ~ [type=armorstand,Name=anything] setblock ~ ~ ~ stone Instead of stone usw ans block you want

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .