How do I make a moving structure with command blocks?

So. I am trying to make a boat move in minecraft. I don't want all those noisy pistons and stuff, and I want to make it move like one block at a time I don't know how to use the clone command. Does anyone know how to make my boat move one block a time?, like the command. What command do I have to put because whenever I try I move it one block forward and to make the previous structure disappear. I want it to move 1 block at a time constantly. Anyone know how to do this, or the command?


Solution 1:

First place the following command in a normal (impulse) command block inside the boat, attached to a simple clock. The speed of the clock will determine the speed the boat moves.

/clone ~<x1> ~<y1> ~<z1> ~<x2> ~<y2> ~<z2> ~<x3> ~ ~<z3> replace move

To calculate the values:

x1 is the number of blocks in the negative x direction from the command block to the edge of the boat, not including the command block, multiplied by -1.

y1 is the number of blocks in the negative y direction from the command block to the bottom of the boat, not including the command block, multiplied by -1.

z1 is the number of blocks in the negative z direction from the command block to the edge of the boat, not including the command block, multiplied by -1.

x2 is the number of blocks in the positive x direction from the command block to the edge of the boat, not including the command block.

y2 is the number of blocks in the positive y direction from the command block to the top of the boat, not including the command block.

z2 is the number of blocks in the positive z direction from the command block to the edge of the boat, not including the command block.

If you want the boat to move in the positive x direction then x3 = 1, z3 = 0.

If you want the boat to move in the negative x direction then x3 = -1, z3 = 0.

If you want the boat to move in the positive z direction then x3 = 0, z3 = 1.

If you want the boat to move in the negative z direction then x3 = 0, z3 = -1.

Hope this helps.

Solution 2:

First place the following command in a normal (impulse) command block inside the boat, attached to a simple clock. The speed of the clock will determine the speed the boat moves.

/clone ~ ~ ~ ~ ~ ~ ~ ~ ~ replace move To calculate the values:

x1 is the number of blocks in the negative x direction from the command block to the edge of the boat, not including the command block, multiplied by -1.

y1 is the number of blocks in the negative y direction from the command block to the bottom of the boat, not including the command block, multiplied by -1.

z1 is the number of blocks in the negative z direction from the command block to the edge of the boat, not including the command block, multiplied by -1.

x2 is the number of blocks in the positive x direction from the command block to the edge of the boat, not including the command block.

y2 is the number of blocks in the positive y direction from the command block to the top of the boat, not including the command block.

z2 is the number of blocks in the positive z direction from the command block to the edge of the boat, not including the command block.

If you want the boat to move in the positive x direction then x3 = 1, z3 = 0.

If you want the boat to move in the negative x direction then x3 = -1, z3 = 0.

If you want the boat to move in the positive z direction then x3 = 0, z3 = 1.

If you want the boat to move in the negative z direction then x3 = 0, z3 = -1.

Hope this helps.