Hi i'm building a mini game for my server but i need some advice how to program the command blocks most efficiently, am trying to make a cubed area decay (replace the blocks with air) over a period of time so that users on top of the object would have to try to stay on top without falling of it, but not sure how to make this simple the only viable method i could come up with was removing layer by layer like cake slices but that is kinda easy to play i guess. If the method could be random everytime too that would be a bonus. i have worldedit commands available, also if there is a way to load the schematic back too that would be awesome since right now am doing it manually.
2
I've never used the command too much myself, but it sounds like you could use the /spreadplayers command to distribute some armor stands around, and then clear the blocks they land on.
The general form for the command looks like this:
For example, say you had a 51x51 square arena centered around x=72 and z=68 you wanted to start putting holes in. The first step would be to summon a certain number of armor stands you can target with a command like this:
Next, you'll want to spread the armor stands over the area and delete what they land on. You can do that with the following commands:
You can then simply run those two commands whenever you want to make another set of holes.
Some things to note:
When the spreadplayers command moves an entity, it only picks the x and z values. It simply places them on the highest block on those coordinates. If your arena isn't below anything, then that shouldn't be a problem. If it is, you'll have to teleport them down before you destroy the blocks.
You can name the armor stands whatever you like, just make sure it has no spaces.
If you want to adjust how far apart the holes are, you can adjust the <spreadDistance> argument. I set it to 1 in the example, but you can use anything less that <maxRange> to get holes further apart.
The general form for the command looks like this:
spreadplayers <x> <z> <spreadDistance> <maxRange> <respectTeams> <players>It takes whatever entities you define with <players>, and spreads them randomly within a square defined by <x>, <z> (the center), and <maxRange>. If you're using entities like armor stands, it's best to always have <respectTeams> set to false.For example, say you had a 51x51 square arena centered around x=72 and z=68 you wanted to start putting holes in. The first step would be to summon a certain number of armor stands you can target with a command like this:
summon ArmorStand ~ ~ ~ {Invisible:1,NoGravity:1,Marker:1,Invulnerable:1,CustomName:"robert"}The more armor stands you spawn, the more holes you'll make with each round.Next, you'll want to spread the armor stands over the area and delete what they land on. You can do that with the following commands:
spreadplayers 72 68 1 25 false @e[name=robert,type=ArmorStand]execute @e[name=robert,type=ArmorStand] ~ ~ ~ setblock ~ ~-1 ~ airYou can then simply run those two commands whenever you want to make another set of holes.
Some things to note:
When the spreadplayers command moves an entity, it only picks the x and z values. It simply places them on the highest block on those coordinates. If your arena isn't below anything, then that shouldn't be a problem. If it is, you'll have to teleport them down before you destroy the blocks.
You can name the armor stands whatever you like, just make sure it has no spaces.
If you want to adjust how far apart the holes are, you can adjust the <spreadDistance> argument. I set it to 1 in the example, but you can use anything less that <maxRange> to get holes further apart.
Well you would always need a block trigger. Like a pressure plate or button, maybe even a lever. Anyways, I'm not sure if you can actually make the block decay, but to make it disappear, you need to do /setblock [coordinates] air. When you step on the pressure plate or click a switch, it would teleport said block to the location in the command block. I'm not sure how to do it randomly, but that's how I know how to do it manually. Sorry.
