Hardware Reference
In-Depth Information
his line connects your program to Minecraft and allows you to start interacting
with it. Remember, you must have Minecraft running and be in a game for your
program to work.
7. Next, create a message string using the following code:
msg = “I am starting my Minecraft Pi Adventures”
hen type the following line to post your message to the Minecraft chat window:
mc.postToChat(msg)
8. Press CTRL+X to exit, and press Y (for yes) to save what you have written. he
message File name to write: testmcpi.py will appear. Press Enter to
conirm that you want to write to this ile. You will then be returned to the com-
mand line in LXTerminal.
9. Now run your script by typing the following line in the LXTerminal tab window:
python testmcpi.py
You will see your message displayed in the Minecraft game window open on
your screen, as shown in Figure 6-3.
FIGURE 6-3 Your irst Minecraft Pi Python program
Search WWH ::




Custom Search