How to Make a Working Tank in Minecraft with Command Blocks

In this post, we will share with you How to Make a Working Tank in Minecraft with Command Blocks. So, read the article carefully to know the perfect way to make a tank in Minecraft with Command Blocks.

How to Make a Working Tank in Minecraft with Command Blocks

You have to learn to build first in Minecraft. Because we know building in Minecraft is not easy. Finally, I managed to create a tutorial for creating your own work tank. The goal of this 3 part tutorial is to explain how to create your own working tank for Minecraft. Eventually, the tank will be able to move, rotate and shoot. Precisely, in this second part, we will focus on the programming part.

Working Tank Minecraft

If you don’t know to use mods and code then don’t worry I have your back. I am giving a video link from Eystreem Youtube channel where he has shown us how to make a working tank in Minecraft Using Command Blocks. Watch the full video and carefully build it perfectly.

 

Tank’s Mobs Minecraft Code

/summon armor_stand ~ ~ ~ {CustomName:”Tank1″,NoGravity:1b,Invisible:1,NoBasePlate:1}

/summon armor_stand ~ ~ ~ {CustomName:”TankTp1″,NoGravity:1b,Invisible:1,NoBasePlate:1}

/summon villager ~ ~-0.25 ~1 {CustomName:”TankSpirit”,NoGravity:1b,Profession:0,Offers:{Recipes:[{rewardExp:0b,maxUses:2147483647,uses:0,buy:{id:”minecraft:barrier”,Count:1b},sell:{id:”minecraft:barrier”,Count:1b}},{rewardExp:0b,maxUses:2147483647,uses:0,buy:{id:”minecraft:barrier”,Count:1b},sell:{id:”minecraft:barrier”,Count:1b}}]},PersistenceRequired:1,NoAI:1,Silent:1,ActiveEffects:[{Id:14,Amplifier:0,Duration:20000000,ShowParticles:0b}]}.

Scoreboards creation:

/scoreboard objectives add BOOM dummy

/scoreboard objectives add WEST dummy

/scoreboard objectives add EAST dummy

/scoreboard objectives add NORTH dummy

/scoreboard objectives add SOUTH dummy

/scoreboard objectives add SHOOT dummy

Shell system:

/scoreboard players set @e[type=arrow,name=Shell] BOOM 1 {inGround:1b}

/execute @e[type=arrow,name=Shell,score_BOOM_min=1] ~ ~ ~ /summon tnt

/kill @e[type=arrow,score_BOOM_min=1]

Creation of a new tank:

Before:

/kill @e[type=armor_stand,name=Tank1]

/kill @e[type=armor_stand,name=TankTp1]

/kill @e[type=villager,name=TankSpirit]

After:

/execute @e[type=armor_stand,c=1,name=Tank1] ~ ~ ~ /scoreboard players set @e[type=armor_stand,name=Tank1]

Move forward:

/execute @e[type=armor_stand,c=1,name=Tank1,score_NORTH_min=1] ~ ~ ~ detect ~X3 ~Y3 ~Z3 lever 11 /clone ~X1 ~Y1 ~Z1 ~X2 ~Y2 ~Z2 ~X1 ~Y1 ~Z1-1 replace move

/execute @e[type=armor_stand,c=1,name=TankTp1] ~ ~ ~ /tp @e[type=!armor_stand,dx=W/,dy=H/,dz=L/] ~ ~ ~-1

/tp @e[type=armor_stand,name=TankTp1] ~ ~ ~-1

/tp @e[type=armor_stand,name=Tank1,score_NORTH_min=1] ~ ~ ~-1

Move backward:

/execute @e[type=armor_stand,c=1,name=Tank1,score_NORTH_min=1] ~ ~ ~ detect ~X4 ~Y4 ~Z3 lever 11 /clone ~X1 ~Y1 ~Z1 ~X2 ~Y2 ~Z2 ~X1 ~Y1 ~Z1+1 replace move

/execute @e[type=armor_stand,c=1,name=TankTp1] ~ ~ ~ /tp @e[type=!armor_stand,dx=W/,dy=H/,dz=L/] ~ ~ ~1

/tp @e[type=armor_stand,name=TankTp1] ~ ~ ~1

/tp @e[type=armor_stand,name=Tank1,score_NORTH_min=1] ~ ~ ~1

Turn left:

/execute @e[type=armor_stand,c=1,name=Tank1,score_NORTH_min=1] ~ ~ ~ detect ~X5 ~Y5 ~Z3 stone_button 11 /scoreboard players set @e[type=armor_stand,name=Tank1,score_NORTH_min=1] WEST 1

/execute @e[type=armor_stand,c=1,name=TankTp1] ~ ~ ~ /tp @e[type=!armor_stand,dx=W/,dy=H/,dz=L/] @e[type=armor_stand,name=Tank1,score_NORTH_min=1,score_WEST_min=1]

/tp @e[type=armor_stand,name=TankTp1] ~X8 ~Y8 ~Z4

/execute @e[type=armor_stand,c=1,name=Tank1,score_NORTH_min=1,score_WEST_min=1] ~ ~ ~ detect ~X5 ~Y5 ~Z3 stone_button 11 /setblock ~XA ~YA ~ZA redstone_block

/execute @e[type=armor_stand,c=1,name=Tank1,score_NORTH_min=1,score_WEST_min=1] ~ ~ ~ detect ~X5 ~Y5 ~Z3 stone_button 11 /scoreboard players set @e[type=armor_stand,name=Tank1,score_NORTH_min=1,score_WEST_min=1] NORTH 0

Turn right:

/execute @e[type=armor_stand,c=1,name=Tank1,score_NORTH_min=1] ~ ~ ~ detect ~X6 ~Y6 ~Z3 stone_button 11 /scoreboard players set @e[type=armor_stand,name=Tank1,score_NORTH_min=1] EAST 1

/execute @e[type=armor_stand,c=1,name=TankTp1] ~ ~ ~ /tp @e[type=!armor_stand,dx=W/,dy=H/,dz=L/] @e[type=armor_stand,name=Tank1,score_NORTH_min=1,score_EAST_min=1]

/tp @e[type=armor_stand,name=TankTp1] ~X9 ~Y8 ~Z4

/execute @e[type=armor_stand,c=1,name=Tank1,score_NORTH_min=1,score_EAST_min=1] ~ ~ ~ detect ~X6 ~Y6 ~Z3 stone_button 11 /setblock ~XB ~YA ~ZA redstone_block

/execute @e[type=armor_stand,c=1,name=Tank1,score_NORTH_min=1,score_EAST_min=1] ~ ~ ~ detect ~X6 ~Y6 ~Z3 stone_button 11 /scoreboard players set @e[type=armor_stand,name=Tank1,score_NORTH_min=1,score_EAST_min=1] NORTH 0

Shoot:

/execute @e[type=armor_stand,c=1,name=Tank1,score_NORTH_min=1] ~ ~ ~ detect ~X7 ~Y7 ~Z3 stone_button 11 /scoreboard players set @e[type=armor_stand,name=Tank1,score_NORTH_min=1] SHOOT 1

/execute @e[type=armor_stand,c=1,name=Tank1,score_SHOOT_min=1,score_NORTH_min=1] ~ ~ ~ /summon arrow ~X10 ~Y9 ~Z5 {Motion:[0.0,0.0,-5.0],CustomName:Shell}

/execute @e[type=armor_stand,c=1,name=Tank1,score_NORTH_min=1,score_SHOOT_min=1] ~ ~ ~ /setblock ~X7 ~Y7 ~Z3 stone_button 3

/scoreboard players set @e[type=armor_stand,name=Tank1,score_SHOOT_min=1,score_NORTH_min=1] SHOOT 0

WEST:
Move forward:
/execute @e[type=armor_stand,c=1,name=Tank1,score_WEST_min=1] ~ ~ ~ detect ~Z3 ~Y3 ~-X3 lever 9 /clone ~Z1 ~Y1 ~X1 ~Z2 ~Y2 ~X2 ~Z1-1 ~Y1 ~X1 replace move

/execute @e[type=armor_stand,c=1,name=TankTp1] ~ ~ ~ /tp @e[type=!armor_stand,dx=L/,dy=H/,dz=W/] ~-1 ~ ~

/tp @e[type=armor_stand,name=TankTp1] ~-1 ~ ~

/tp @e[type=armor_stand,name=Tank1,score_WEST_min=1] ~-1 ~ ~

Move backward:

/execute @e[type=armor_stand,c=1,name=Tank1,score_WEST_min=1] ~ ~ ~ detect ~Z3 ~Y4 ~-X4 lever 9 /clone ~Z1 ~Y1 ~X1 ~Z2 ~Y2 ~X2 ~Z1+1 ~Y1 ~X1 replace move

/execute @e[type=armor_stand,c=1,name=TankTp1] ~ ~ ~ /tp @e[type=!armor_stand,dx=L/,dy=H/,dz=W/] ~1 ~ ~

/tp @e[type=armor_stand,name=TankTp1] ~1 ~ ~

/tp @e[type=armor_stand,name=Tank1,score_WEST_min=1] ~1 ~ ~

Turn left:

/execute @e[type=armor_stand,c=1,name=Tank1,score_WEST_min=1] ~ ~ ~ detect ~Z3 ~Y5 ~-X5 stone_button 9 /scoreboard players set @e[type=armor_stand,name=Tank1] SOUTH 1

/execute @e[type=armor_stand,c=1,name=TankTp1] ~ ~ ~ /tp @e[type=!armor_stand,dx=L/,dy=H/,dz=W/] @e[type=armor_stand,name=Tank1,score_WEST_min=1,score_SOUTH_min=1]

/tp @e[type=armor_stand,name=TankTp1] ~Z4 ~Y8 ~X9

/execute @e[type=armor_stand,c=1,name=Tank1,score_WEST_min=1,score_SOUTH_min=1] ~ ~ ~ detect ~Z3 ~Y5 ~-X5 stone_button 9 /setblock ~XA ~YA ~ZA redstone_block

/execute @e[type=armor_stand,c=1,name=Tank1,score_WEST_min=1,score_SOUTH_min=1] ~ ~ ~ detect ~Z3 ~Y5 ~-X5 stone_button 9 /scoreboard players set @e[type=armor_stand,name=Tank1,score_WEST_min=1,score_SOUTH_min=1] WEST 0

Turn right:

/execute @e[type=armor_stand,c=1,name=Tank1,score_WEST_min=1] ~ ~ ~ detect ~Z3 ~Y6 ~-X6 stone_button 9 /scoreboard players set @e[type=armor_stand,name=Tank1] NORTH 1

/execute @e[type=armor_stand,c=1,name=TankTp1] ~ ~ ~ /tp @e[type=!armor_stand,dx=L/,dy=H/,dz=W/] @e[type=armor_stand,name=Tank1,score_WEST_min=1,score_NORTH_min=1]

/tp @e[type=armor_stand,name=TankTp1] ~Z4 ~Y8 ~X8

/execute @e[type=armor_stand,c=1,name=Tank1,score_WEST_min=1,score_NORTH_min=1] ~ ~ ~ detect ~Z3 ~Y6 ~-X6 stone_button 9 /setblock ~XB ~YA ~ZA redstone_block

/execute @e[type=armor_stand,c=1,name=Tank1,score_WEST_min=1,score_NORTH_min=1] ~ ~ ~ detect ~Z3 ~Y6 ~-X6 stone_button 9 /scoreboard players set @e[type=armor_stand,name=Tank1,score_WEST_min=1,score_NORTH_min=1] WEST 0
Shoot:
/execute @e[type=armor_stand,c=1,name=Tank1,score_WEST_min=1] ~ ~ ~ detect ~Z3 ~Y7 ~-X7 stone_button 9 /scoreboard players set @e[type=armor_stand,name=Tank1,score_WEST_min=1] SHOOT 1

/execute @e[type=armor_stand,c=1,name=Tank1,score_SHOOT_min=1,score_WEST_min=1] ~ ~ ~ /summon arrow ~Z5 ~Y9 ~-X10 {Motion:[-5.0,0.0,0.0],CustomName:Shell}

/execute @e[type=armor_stand,c=1,name=Tank1,score_WEST_min=1,score_SHOOT_min=1] ~ ~ ~ /setblock ~Z3 ~Y7 ~-X7 stone_button 1

/scoreboard players set @e[type=armor_stand,name=Tank1,score_SHOOT_min=1,score_WEST_min=1] SHOOT 0

EAST:
Move forward:

/execute @e[type=armor_stand,c=1,name=Tank1,score_EAST_min=1] ~ ~ ~ detect ~-Z3 ~Y3 ~X3 lever 10 /clone ~-Z1 ~Y1 ~X1 ~-Z2 ~Y2 ~X2 ~-Z1+1 ~Y1 ~X1 replace move

/execute @e[type=armor_stand,c=1,name=TankTp1] ~ ~ ~ /tp @e[type=!armor_stand,dx=L/,dy=H/,dz=W/] ~1 ~ ~

/tp @e[type=armor_stand,name=TankTp1] ~1 ~ ~

/tp @e[type=armor_stand,name=Tank1,score_EAST_min=1] ~1 ~ ~

Move backward:

/execute @e[type=armor_stand,c=1,name=Tank1,score_EAST_min=1] ~ ~ ~ detect ~-Z3 ~Y4 ~X4 lever 10 /clone ~-Z1 ~Y1 ~X1 ~-Z2 ~Y2 ~-X2 ~-Z1-1 ~Y1 ~X1 replace move

/execute @e[type=armor_stand,c=1,name=TankTp1] ~ ~ ~ /tp @e[type=!armor_stand,dx=L/,dy=H/,dz=W/] ~-1 ~ ~

/tp @e[type=armor_stand,name=TankTp1] ~-1 ~ ~

/tp @e[type=armor_stand,name=Tank1,score_EAST_min=1] ~-1 ~ ~

Turn left:

/execute @e[type=armor_stand,c=1,name=Tank1,score_EAST_min=1] ~ ~ ~ detect ~-Z3 ~Y5 ~X5 stone_button 10 /scoreboard players set @e[type=armor_stand,name=Tank1,score_EAST_min=1] NORTH 1

/execute @e[type=armor_stand,c=1,name=TankTp1] ~ ~ ~ /tp @e[type=!armor_stand,dx=L/,dy=H/,dz=W/] @e[type=armor_stand,name=Tank1,score_EAST_min=1,score_NORTH_min=1]

/tp @e[type=armor_stand,name=TankTp1] ~-X9 ~Y8 ~X8

/execute @e[type=armor_stand,c=1,name=Tank1,score_EAST_min=1,score_NORTH_min=1] ~ ~ ~ detect ~-Z3 ~Y5 ~X5 stone_button 10 /setblock ~XA ~YA ~ZA redstone_block

/execute @e[type=armor_stand,c=1,name=Tank1,score_EAST_min=1,score_NORTH_min=1] ~ ~ ~ detect ~-Z3 ~Y5 ~X5 stone_button 10 /scoreboard players set @e[type=armor_stand,name=Tank1,score_EAST_min=1,score_NORTH_min=1] EAST 0

Turn right:

/execute @e[type=armor_stand,c=1,name=Tank1,score_EAST_min=1] ~ ~ ~ detect ~-Z3 ~Y6 ~X6 stone_button 10 /scoreboard players set @e[type=armor_stand,name=Tank1,score_EAST_min=1] SOUTH 1

/execute @e[type=armor_stand,c=1,name=TankTp1] ~ ~ ~ /tp @e[type=!armor_stand,dx=L/,dy=H/,dz=W/] @e[type=armor_stand,name=Tank1,score_EAST_min=1,score_SOUTH_min=1]

/tp @e[type=armor_stand,name=TankTp1] ~-X9 ~Y8 ~X9

/execute @e[type=armor_stand,c=1,name=Tank1,score_EAST_min=1,score_SOUTH_min=1] ~ ~ ~ detect ~-Z3 ~Y6 ~X6 stone_button 10 /setblock ~XB ~YA ~ZA redstone_block

/execute @e[type=armor_stand,c=1,name=Tank1,score_EAST_min=1,score_SOUTH_min=1] ~ ~ ~ detect ~-Z3 ~Y6 ~X6 stone_button 10 /scoreboard players set @e[type=armor_stand,name=Tank1,score_EAST_min=1,score_SOUTH_min=1] EAST 0

Shoot:

/execute @e[type=armor_stand,c=1,name=Tank1,score_EAST_min=1] ~ ~ ~ detect ~-Z3 ~Y7 ~X7 stone_button 10 /scoreboard players set @e[type=armor_stand,name=Tank1,score_EAST_min=1] SHOOT 1

/execute @e[type=armor_stand,c=1,name=Tank1,score_SHOOT_min=1,score_EAST_min=1] ~ ~ ~ /summon arrow ~-Z5 ~Y9 ~X10 {Motion:[5.0,0.0,0.0],CustomName:Shell}

/execute @e[type=armor_stand,c=1,name=Tank1,score_EAST_min=1,score_SHOOT_min=1] ~ ~ ~ /setblock ~-Z3 ~Y7 ~X7 stone_button 2

/scoreboard players set @e[type=armor_stand,name=Tank1,score_SHOOT_min=1,score_EAST_min=1] SHOOT 0

SOUTH:

Move forward:

/execute @e[type=armor_stand,c=1,name=Tank1,score_SOUTH_min=1] ~ ~ ~ detect ~-X3 ~Y3 ~-Z3 lever 12 /clone ~X1 ~Y1 ~-Z1 ~X2 ~Y2 ~-Z2 ~X1 ~Y1 ~-Z1+1 replace move

/execute @e[type=armor_stand,c=1,name=TankTp1] ~ ~ ~ /tp @e[type=!armor_stand,dx=W/,dy=H/,dz=L/] ~ ~ ~1

/tp @e[type=armor_stand,name=TankTp1] ~ ~ ~1

/tp @e[type=armor_stand,name=Tank1,score_SOUTH_min=1] ~ ~ ~1

Move backward:

/execute @e[type=armor_stand,c=1,name=Tank1,score_SOUTH_min=1] ~ ~ ~ detect ~-X4 ~Y4 ~-Z3 lever 12 /clone ~X1 ~Y1 ~-Z1 ~X2 ~Y2 ~-Z2 ~X1 ~Y1 ~-Z1-1 replace move

/execute @e[type=armor_stand,c=1,name=TankTp1] ~ ~ ~ /tp @e[type=!armor_stand,dx=W/,dy=H/,dz=L/] ~ ~ ~-1

/tp @e[type=armor_stand,name=TankTp1] ~ ~ ~-1

/tp @e[type=armor_stand,name=Tank1,score_SOUTH_min=1] ~ ~ ~-1

Turn left:

/execute @e[type=armor_stand,c=1,name=Tank1,score_SOUTH_min=1] ~ ~ ~ detect ~-X5 ~Y5 ~-Z3 stone_button 12 /scoreboard players set @e[type=armor_stand,name=Tank1] EAST 1

/execute @e[type=armor_stand,c=1,name=TankTp1] ~ ~ ~ /tp @e[type=!armor_stand,dx=W/,dy=H/,dz=L/] @e[type=armor_stand,name=Tank1,score_SOUTH_min=1,score_EAST_min=1]

/tp @e[type=armor_stand,name=TankTp1] ~X9 ~Y8 ~-X9

/execute @e[type=armor_stand,c=1,name=Tank1,score_SOUTH_min=1,score_EAST_min=0] ~ ~ ~ detect ~-X5 ~Y5 ~-Z3 stone_button 12 /setblock ~XA ~YA ~ZA redstone_block

/execute @e[type=armor_stand,c=1,name=Tank1,score_SOUTH_min=1,score_EAST_min=0] ~ ~ ~ detect ~-X5 ~Y5 ~-Z3 stone_button 12 /scoreboard players set @e[type=armor_stand,name=Tank1,score_SOUTH_min=1,score_EAST_min=0] SOUTH 0

Turn right:

/execute @e[type=armor_stand,c=1,name=Tank1,score_SOUTH_min=1] ~ ~ ~ detect ~-X6 ~Y6 ~-Z3 stone_button 12 /scoreboard players set @e[type=armor_stand,name=Tank1,score_SOUTH_min=1] WEST 1

/execute @e[type=armor_stand,c=1,name=TankTp1] ~ ~ ~ /tp @e[type=!armor_stand,dx=W/,dy=H/,dz=L/] @e[type=armor_stand,name=Tank1,score_SOUTH_min=1,score_WEST_min=1]

/tp @e[type=armor_stand,name=TankTp1] ~X8 ~Y8 ~-X9

/execute @e[type=armor_stand,c=1,name=Tank1,score_SOUTH_min=1,score_WEST_min=1] ~ ~ ~ detect ~-X6 ~Y6 ~-Z3 stone_button 12 /setblock ~XB ~YA ~ZA redstone_block

/execute @e[type=armor_stand,c=1,name=Tank1,score_SOUTH_min=1,score_WEST_min=1] ~ ~ ~ detect ~-X6 ~Y6 ~-Z3 stone_button 12 /scoreboard players set @e[type=armor_stand,name=Tank1,score_SOUTH_min=1,score_WEST_min=1] SOUTH 0

Shoot:

/execute @e[type=armor_stand,c=1,name=Tank1,score_SOUTH_min=1] ~ ~ ~ detect ~-X7 ~Y7 ~-Z3 stone_button 12 /scoreboard players set @e[type=armor_stand,name=Tank1,score_SOUTH_min=1] SHOOT 1

/execute @e[type=armor_stand,c=1,name=Tank1,score_SHOOT_min=1,score_SOUTH_min=1] ~ ~ ~ /summon arrow ~-X10 ~Y9 ~-Z5 {Motion:[0.0,0.0,5.0],CustomName:Shell}

/execute @e[type=armor_stand,c=1,name=Tank1,score_SOUTH_min=1,score_SHOOT_min=1] ~ ~ ~ /setblock ~-X7 ~Y7 ~-Z3 stone_button 4

/scoreboard players set @e[type=armor_stand,name=Tank1,score_SHOOT_min=1,score_SOUTH_min=1] SHOOT 0

End of the commands.

I give you again the coordinates:

XA YA ZA: redstone block when you turn left

XB YA ZA: redstone block when you turn right

X1 Y1 Z1 X2 Y2 Z2: size of the complete tank (the X1 Y1 Z1 are the smallest and the X2 Y2 Z2 are the biggest).

W/ H/ L/: width, height and length.

X3 Y3 Z3: lever move forward

X4 Y4 Z3: lever mover backward

X5 Y5 Z3: button turn left

X6 Y6 Z3: button turn right

X7 Y7 Z3: button shoot

X8 Y8 Z4: Tanktp1 first way

X9 Y8 Z4: Tanktp1 second way

X10 Y9 Z5: canon mouth.

Huge shoutout to DragonMania17 for the amazing code. This code was made by him.

Conclusion

So, We have shared with you how to Make a Working Tank in Minecraft with Command Blocks. If the Article has helpful then don’t forget to live a Comment.

Leave a Comment