How to set a command block with a command inside using a worldedit command

by TheUnsubbedGamer   Last Updated May 28, 2018 08:14 AM

so i've been making a server, and i cant get the worldprotect mod to do block-break deny so, i've been trying to set a lot of command blocks manually, and then i got lazy. i've been trying to find an answer for this ever since. here is my command: //set command_block {Command:"/gamemode adventure @p"} but when i try to place it, it gets placed but the command is not in the command blocks. And it shows this message: the last 2 purple sentences and the last 2 red sentences.

so, if there is a way to fix this, please tell me the command. thanks!

Answers 1

Use the /fill command, which goes like this:

/fill [x1] [y1] [z1] [x2] [y2] [z2] [block] [data value]

Say you wanted to fill 100x1x100, you would do something like this:

/fill ~ ~ ~ ~100 ~ ~100 command_block {Command:"/gamemode adventure @p"}

Note the ~ means relative coordinates.

But a more logical thing to do would be to set a single command block with this command:

/gamemode adventure @a[r=100]

This would target any player withing a radius of 100 blocks.

May 28, 2018 08:12 AM

Related Questions

Can I flip a WorldEdit selection horizontally?

Updated April 23, 2018 17:14 PM

Minecraft: share edits to "Master" world

Updated May 17, 2018 19:14 PM

Making a server with a realm map

Updated October 21, 2017 18:14 PM

How can I get WorldEdit on my MCPE world

Updated January 24, 2018 19:14 PM

How to update all blocks in a chunk?

Updated May 05, 2016 08:06 AM