Learn to Code with Minecraft Setup for Mac

I have wanted my sons to learn how to program using python. However, this is not as easy as it may seem using a Mac. I have used the book Learn to Code with Minecraft for this purpose, but the Mac instructions are not as detailed as I would like. Therefore, I am writing down what I have found to work best. I will start with the tools, software and packages you need to install.

  • Xcode command line tools
  • homebrew
    • pyenv
    • xz
    • tcl-tk
    • zlib
    • sqlite
    • python
      • mcpi package
    • java
    • maven
  • Spigot Server
  • JuicyRaspberryPie Plugin

Firs you want to install the command line tools for your version of macOS. This is done by typing the following code into the terminal window:

 xcode-select --install

Once you complete this step, you can now install home-brew without any worries. While yo can install home-brew first, and it will install the Xcode command line tools, I prefer to install them myself first, to ensure I have the most up to date tools installed.

I will only link the the homebrew website, as it has a one-line piece of code to enter into the terminal window.

Homebrew Site

Once you complete the install of homebrew, you can install in quick succession the following packages: pyenv, xz, tck-tk, lib, and sqlite. I install all these packages before I use peen to install python. This is because, pyenv will use the Xcode tools for the python install, and I experience problems with tkinter, and using IDLE afterwards. In the command line tool, you type each install once it completes.

brew install pyenv
brew install xz
brew install tcl-tk
brew install zlib
brew install sqlite

After installing these packages it is time to setup pyenv, and python. First you want to make sure that you setup your .zshrc file, in the command line type:

export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init --path)"
eval "$(pyenv virtualenv-init -)"

now you can install python using pyenv

pyenv install 3.10
pyenv global 3.10
python -V

After completing the installation of python, you must install Java. I use Zulu, you need to make sure you look at the spigot server, to see what version of java you will need. version 1.18 requires java 17 so I used that version.

brew tap homebrew/cask-versions
brew install --cask zulu17

Then I install the maven build tool. It is used by spigot to build the spigot server.

brew install maven

Once we are done with all these tools, now we can build and install the spigot server for Minecraft. I follow the instructions here to do so. https://www.spigotmc.org/wiki/buildtools/

However here is a summary:

  • Step 1, download Build tools here:Build Tools Jenkins
  • Step 2: Move the Build Tools .jar file to the folder of your choice. I chose MinecraftServer in home directory.
  • Step 3: Open a text editor, and create the script below, do not make any changes.
    • #!/bin/shcd “$(dirname “$0″)”
      exec java -Xms1G -Xmx1G -jar BuildTools.jar nogui
    • chmod
  • Step 4: save script as build.command in the folder with build tools.jar
  • STep 5: Now the tricky part.
    • • Open terminalNeed to use sudo
      • Type chmod a+x with a space after it. DON’T HIT ENTER
      • Drag in the build.command file. Hit enter.
  • Step 6: After it builds, you will have a new spigot server jar file
    • it will build a jar file named spigot-#.##.#.jar with the version number
  • Create a new script file
    • substitute the name of your spigot.jar file, and enter
    • do not modify cd”(dirname”…. dirname is a system variable
  • #!/bin/sh

    IDLE &
    open “/Applications/Minecraft.app” #this starts Minecraft
    open “/System/Applications/Books.app” #this starts book app for ebook for sons.

    cd “$(dirname “$0″)”
    exec java -Xms1G -Xmx1G -jar spigot-1.18.1.jar
  • Step 8: save and chmod file like above, make sure that the script refers to the proper spigot.jar file. Save as start.command
  • Step 9: click start.command, the first time, it will fail because you need to agree to the EULA.
  • Step 10: go tin to the Eula.txt, in the folder you originally created, and open Eula.txt
  • Step 11: change line Eula = False to eula=true
  • Step 12: try start.command again.

You need to start the spigot server at least once to make sure that the plugins folder is created. Then you can move on to the RaspberryJuicePie plugin, found at the following link: Raspberry Juice Pie Plugin You place the link in the plugins folder of the location where your server file is found.

Finally you install mcpi package for python.

pip install mcpi