Hardware Reference
In-Depth Information
It's important that you save the program in the MyAdventures folder. This
is where you will save all your Adventures in Minecraft programs, because it
contains everything you need to get your programs running.
5. Now it's time to start programming! Type the following code into the IDLE edi-
tor window to start the Hello Minecraft World program. Make sure you get the
upper and lower case letters correct, as Python is case-sensitive :
import mcpi.minecraft as minecraft
mc = minecraft.Minecraft.create()
mc.postToChat("Hello Minecraft World")
Python is a case-sensitive programming language, which means that you must
enter characters in upper or lower case correctly. For example, Python will treat
Minecraft (upper case) differently to minecraft (lower case). If you enter them
incorrectly it will result in errors, and you will have to retrace your steps to see
where you went wrong.
You will learn more about what this code means and does in the next adventure.
For now, you're keeping it simple and just get the words “Hello Minecraft World”
on the screen to prove that everything works.
6. Save your program by choosing File Save from the IDLE editor menu.
Running a Program
In future adventures, the instructions will tell you to run a program. If you ever
need a reminder of how to run a Python program, just refer back to this section.
 
 
Search WWH ::




Custom Search