Make sure you are logged in to the Minecraft EDU server and pause the game.
In Finder, in your python folder you will find a starter program called sandbox.py. Right click on that file and click Open With, choose Sublime Text.
First, let's just get connected.
In the below script, make sure you type your own login name where it says name="my login name".
Save the file.
In Terminal, type (without quotes) "python sandbox.py" and hit return.
Go back to Minecraft and look at the chat. It should say "I connected!"
Congratulations, you have connected!
2) .player.getPos(), player.getTilePos()
Find out what your position in the world you are standing in, and what block tile you are standing on. To do this you will make a variable for each one that gets that player information. Then you will post that variable information to the chat.
Things to notice:
You can add variables and "plain text in quotes" by concatenating them. That is the + in the postToChat argument.
The "str()" method has to be used to convert the playerPos variable to a plain text "string". You can't concatenate a string (the stuff in quotes) with a different variable type, so you have to convert it to a string.
To run your new program, save it (Cmd + s) go back to Terminal and run "python sandbox.py" again.
3) time.sleep()
Wow, don't you wish that postToChat would wait a minute so you have time to get there and see it? Import the "time" module and make the program "sleep" for a few seconds. Now run your program again.
Lesson 1 is done! Don't forget to answer questions for Lesson 1 in MyHewitt.