Minecraft Pi_ Introduction to Python

Arguments are variables that are required to call a function and have it execute. In the case of the last step, we called the function setBlock() and then filled in arguments to tell the function how to execute. The position variables (x, y, z) were created by our code but what about the number?

It can be confusing but since numbers are just text to a computer, they can also be used to define variables. The set.Block() function defines the block type using a number. The number 1 is stone. There are 93 basic block types that are supported by Minecraft Pi and some of the basic types also have color options (wool, for instance). With out moving, try changing the code to any number between 0 and 83. Save and run your code.

What happened when you ran your code?

A -        The block changed types.

B -        Another block appeared  next  to  the  first  one. C -        Another block appeared on top of the first one.

D -        Another block appeared next to your character.

Return to top