I wanted to make an Among Us style map on Minecraft Bedrock Edition, (to play with friends) and I was trying to make the "Eject trash" task and want the dirt block that is placed outside of the window to be placed in a random position, within a 9x9 block radius, but I don't know any command to do this. Is there a way to input coordinates that randomize where is it placed?

  • Install WorldEdit on your server and use the //fill command. The vanilla fill command doesn't support percentage selection
    – hfanatic
    Dec 9, 2021 at 13:09
  • @hfanatic world edit isnt on bedrock
    – Penguin
    Dec 10, 2021 at 3:52

1 Answer 1


You could summon an armour stand:

summon armour_stand dirt_location

Then use /spreadplayers to randomise its location:

spreadplayers ~ ~ 10 11 @e[name=dirt_location]

Then use /execute to set the block:

execute @e[name=dirt_location] ~ ~ ~ setblock ~ ~ ~ dirt

And finally, remove the armour stand with:

kill @e[name=dirt_location]

You will want all those commands chained together with chain command blocks.

You must log in to answer this question.

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