-4

I’ve been making a server, and I can’t 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"}

When I try to place it, it gets placed but the command is not in the command blocks. 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!

5
  • WE's //set doesn't support these tags. And what's the point in having 1000s of command blocks with the same command? Why don't you use setblock?
    – dly
    May 28, 2018 at 7:29
  • when i used the setblock command, /setblock command_block {Command:"/gamemode adventure @p"}, it tells me that "command_block is not a valid number" May 28, 2018 at 7:36
  • That's because you forgot the coordinates. And you can just use /fill. I don't really see your problem. You're probably trying it a harder way than you have to. Worldedit is for more complicated things and for bigger areas than Vanilla allows, you don't need it for such a simple thing. May 28, 2018 at 7:54
  • I recommend you ask another question but explain what you want to do/prevent and include what you have tried. A bigger picture kind of question. This way people can suggest alternative solutions.I don't know what you are trying to do but I can almost assure you there is a better solution then 1000's of command blocks.
    – IronAnvil
    May 28, 2018 at 15:47
  • Your setblock command is missing coordinates and needs to specify dataValue and oldBlockHandling in order to specify dataTag information. Like this: /setblock ~ ~ ~ command_block 0 replace {Command:"gamemode adventure @p"}.
    – IronAnvil
    May 28, 2018 at 15:50

1 Answer 1

0

WE doesn't support that kind of argument.

Use the /fill command, which goes like this:

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

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

/fill ~ ~ ~ ~100 ~ ~100 command_block 0 replace {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.

2
  • Your fill command syntax is incorrect. If you execute your command it will result in an error: '{Command:"/gamemode' is not a state for block minecraft:command_block. This is because you need to specify dataValue and oldBlockHandling in order to specify dataTag information. Like this: /fill ~ ~ ~ ~100 ~ ~100 command_block 0 replace {Command:"gamemode adventure @p"}.
    – IronAnvil
    May 28, 2018 at 15:40
  • Indeed you are correct, editing to fix it
    – TQ1000
    May 28, 2018 at 15:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .