This question already has an answer here:

I am trying to make a spaceship that can go up and down basically. When it goes up, I want the command block to have a command. That's where I ran into a problem; I couldn't find a way to move a command block while keeping the command it has in it. I know how to use command blocks to make blocks appear, but is there anyway to make a command block with a command in it with another command block?

I basically just want to make a command block with a command in it by using /setblock in another command block (if its possible)

side question: when they release the /clone command in the next update, will that work similar to this?

marked as duplicate by FoxMcCloud, Virusbomb, greg-449, user232393, Joachim Jul 9 at 20:27

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.

  • How about have 2 command blocks. One that removes the old ones, and one that makes new ones? – Jojodmo May 16 '14 at 5:36

You pretty much answered your own question with your side question. Currently there is no way to do this in minecraft but the upcoming clone command will make this possible. For reference sake I have below a link to a SethBling video as he shows off these features in one of his snapshot videos:

  • WOW it will even copy the command blocks to!!! thanks – mdlp0716 May 15 '14 at 21:11

I think there is a way to /setblock a command block with a command in it. I've seen it, and used to do it, but forgot how, but I think the setblock command is:

/setblock (cordinates) command_block replace 0 {command:-your command-}

I think this should work with plugins, but plugins somehow change up the use of commands sometimes. If I find out anything wrong about the way I said the command, I'll try and remember to come back on and edit it.

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