Minecraft – How to set up a complex minecraft command

minecraft-commandsminecraft-java-edition

I am a total noob at commands. I can do really simple ones like fill-replace stone to air in a specific area, but I can't figure out how to set up the code for things which require more complex logic or combined arguments. At the moment I'm trying to set up a command block to pick a random jungle wood stair block and replace it with an acacia wood stair and keep doing this until I shut it down, to try and give the roof on my large scale building a weathered look. Can somebody please explain how to code that and why all the parts are set up the way they are?

Best Answer

While this isn't vanilla, I would use worldedit for this. Much simpler.

Just select the area with the worldedit wand then do:

//replace junglestair:DATAVALUE 10%acaciastair:DATAVALUE,90%junglestair:DATAVALUE

which will replace 10% of your jungle stairs with acacia stairs. You'll have to do the command once for each stair orientation though. (Replace "DATAVALUE" with the proper number for each orientation)

You'll need the clientside mod or the plugin (on a bukkit/spigot server) to do this though.