How do I randomize block position with /setblock in Minecraft Bedrock Edition?



  • 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?



  • You could summon an armour stand with summon armour_stand dirt_location. Then use the spread players command to randomise its location with spreadplayers ~ ~ 10 11 @e[name=dirt_location]. Then use execute @e[name=dirt_location] ~ ~ ~ setblock ~ ~ ~ dirt and finally kill @e[name=dirt_location]. You will want all those commands chained together with chain command blocks.




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2