1

This question already has an answer here:

So I'm making this adventure map, and kinda got tired of placing NBT command blocks one by one.

Is there a way to fill an area with command blocks that already have a command in them?

The closest i got was just filling an area with command blocks, then manually putting the command on each one of them. But honestly that was too tiresome.

/fill ~ ~-1 ~ ~15 ~-1 ~15 minecraft:command_block 

Am i missing anything?

marked as duplicate by Joachim, Virusbomb, greg-449, B. S. Morganstein, Tim S. Jul 18 at 1:32

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

3

You can fill them with the same command, like so:

/fill ~ ~-1 ~ ~15 ~-1 ~15 minecraft:command_block 0 replace {Command:"/hey"}

Not the answer you're looking for? Browse other questions tagged or ask your own question.