Minecraft Pi_ Introduction to Python

The command to create a single block is set.Block() but to create multiple blocks we need to make it plural, set.Blocks(). With this command we can create solid objects from multiple blocks. Try adding this to the bottom of your code:

stone = 1 x, y, z = mc.player.getPos() mc.setBlocks(x+1, y+1, z+1, x+11, y+11, z+11, stone)

A massive block of stone should have appeared in the air in front of your character. Notice how we have two sets of x,y,z arguments. The first tells the program where to start and the second tells the program where to stop. Try creating blocks of different sizes. Keep in mind the bigger the block the more time to process creating it.

Return to top