How can I place a block randomly around my world?

I downloaded a lucky block mod and I want to place them randomly in my world. Is there a command to do this? I'd prefer the entire world to be affected but if it's just around 200 blocks then that's fine.


Solution 1:

There isn't one command but you could do it with a few:

  1. Summon large amounts of entities. Armour stands are probably the best as they can't move.
  2. Use the spreadplayers command to distribute them around the world.
  3. Use the execute command to setblock your lucky block at each armour stands' position.
  4. Use the kill command to remove all the armour stands.

Links on each commands' syntax are below.

Spreadplayers

Execute

Setblock

Kill