Meeting 2019-12-10

Continuing with software installation

40 minutes goes pretty fast when you are trying to get everthing working all at once, so we didn't finish installing the software on the Lowell laptops. I don't want to make everyone wait through another whole class time without doing something fun so I will try to get to school early and do as much of the setup as I can. With luck we can spend the class period testing the Python to Minecraft connection and running some of the demos that come with the Raspberry Jam mod.

Installing the Software

These are the same instructions as last week, just copied here for convenience.

We need to install Java, Minecraft 1.12.2, Minecraft Forge, Python 3.8, and the Raspberry Jam Mod and example programs. We will follow the instructions from mod author Alexander Pruss on Instructables:

    1. Install the Java SE Runtime - Version 8.231 from the Java website. The installer will download the right Java version for your computer.

    2. Install the Minecraft Java Edition Launcher (if it isn't already installed on your laptop.)

    3. Run the Minecraft Launcher. Log in using your personal Minecraft account, a Lowell account, or an account the instructor provides.

    4. In the top menu bar, click Installations, and add a New installation for MC 1.12.2. Call it "MC 1.12.2" and pick VERSION "release 1.12.2", then click Create.

    5. Back in the Installations menu, click Play on the Python MC 1.12.2 you just created. Have it download the v1.22.2 files but click on "Quit Game" at the MC menu - you don't need to create a world.

    6. Download and run Minecraft Forge for MC 1.12.2 - the latest Windows Installer. Be patient while the AdFoc.us page counts down and click the gray "skip" button in the upper right to download. Run the .exe and click OK to Install Client in the default location. It will download some additional libraries.

    7. Run the MC Launcher again, under Installations you should have an entry for "1.12.2-forge". Run it and make sure Forge is loading - it has a different MC startup screen. Click on "Quit Game" again to exit.

    8. Download and install Python 3.8.0 from python.org. The default should be the 32-bit version. In the installer, select "Add Python 3.8 to PATH" at the bottom, and click the default "Install Now".

    9. Now download and run RaspberryJamMod-Installer.exe from the arpruss GitHub v0.94 release. Accept the agreement. Leave "Raspberry Jam Mod" checked, check "Sample Python scripts and mcpi framework" but DO NOT install Python3 - click to clear the "Python interpreter" checkbox. The installer should say it requires 4.4MB of disk space.

    10. Run the Minecraft Forge 1.12.2 installation again. Check in the lower left of the startup screen that there are 5 mods installed, including the RaspberryJamMod.

    11. Click on Singleplayer mode and "Create New World" to create a new test world. Name it "Python World" (or something more creative), select Game mode: Creative, and press "More World Options...". Press "World Type:" to get "Superflat" and optionally Customize your flat world. Leave "Allow Cheats: ON" and press "Create New World" at the bottom.

    12. Once in your new world, enter /py donut to test Python script running - it should make a huge glass torus filled with water! If it says "[ERR] Python not found" you need to reinstall Python and check the Add to PATH box.

    13. Set Minecraft to be windowed (not full screen) by pressing ESC, then Options->Video Settings->Fullscreen->OFF. Resize the MC window to 2/3rds of your screen area to make room for the Python editor.

    14. Open IDLE from Python using the Recently Added group of the Windows Start Menu. Select File->New File, and enter the following program in the editor window:

      1. from mine import *

      2. mc = Minecraft()

      3. mc.postToChat("Hello Minecraft World from Lowell")

    15. Save the program as HelloLowell.py in the Python scripts folder: %appdata%\.minecraft\mcpipy

    16. In Minecraft enter "/py HelloLowell" and look for the message in the console

If you saw the glass donut and the console message, your Minecraft+Python installation is working! Try running some of the other demo Python programs by entering the /py <programname> command in Minecraft. You can press <tab> to see a list of the files you can try. Some of them take a while to generate all the blocks, so keep on the lookout if you don't see anything at first.

Once everything is working, exit Minecraft. To avoid future confusion, run the Minecraft Launcher again and under Installations, you can delete the original "MC 1.12.2" instance, and rename the "forge" one to be "Python MC Forge 1.12.2", which is what we will be running from now on.

Next week we will start programming once everyone has the software installed.