Lesson 8: Sidekick

Building an Iron golem friend!


Now we will use code to help us build an iron golem and help us fight through the zombie temple.


#IRON GOLEM
import mcpi.minecraft as minecraft
import mcpi.block as block
mc = minecraft.Minecraft.create()
playerPos = mc.player.getPos()
mc.setBlock(playerPos.x,playerPos.y,playerPos.z,block.IRON_BLOCK)
mc.setBlock(playerPos.x,playerPos.y+1,playerPos.z,block.IRON_BLOCK)
mc.setBlock(playerPos.x-1,playerPos.y+1,playerPos.z,block.IRON_BLOCK)
mc.setBlock(playerPos.x+1,playerPos.y+1,playerPos.z,block.IRON_BLOCK)
mc.setBlock(playerPos.x,playerPos.y+2,playerPos.z,91)