Minecraft
Minecraft

Minecraft is a great platform to make learning programming fun and with the ScriptCraft plugin it becomes even more accessible.

To quote the ScriptCraft website:

ScriptCraft is a Minecraft Mod that lets you extend Minecraft using the Javascript Programming Language. ScriptCraft makes modding Minecraft easier. It includes a logo-like “Drone” object that can be used to build complex buildings, roads, villages, even entire cities. It also includes many other features that make modding Minecraft easier.

Running your own server locally

If you want to set up your own server locally to run ScriptCraft you can follow these steps

Windows

  1. Download and install Java 1.8 (actually any version > 1.6 should work)

  2. Create a CanaryMod folder in the root of the C: drive

    C:\CanaryMod

  3. Download the CanaryMod 1.2.0 jar file and put it in the C:\CanaryMod folder
    • We use CanaryMod instead of a vanilla Minecraft server as it facilitates plugins such as ScriptCraft. As a side note it’s also possible to use other modded servers such as Spigot but to get started CanaryMod is much simpler!
  4. To allow the server to start on the first try create a C:\CanaryMod\eula.txt file with the following content (otherwise it will ask you to edit this file and accept the eula)

    eula=true

  5. Create a C:\CanaryMod\start.bat file with the following content

    java -jar CanaryMod-1.2.0.jar pause - I find it nicer to run this without the GUI in case errors occur during initialization (eg. with bad config) - It’s still possible to directly enter commands in the server’s console. - If you do want to use the GUI then just remove the “java -jar” part from the front of the command or even skip the start.bat file and double click the jar file directly to start the server

  6. Start the server for the first time by double clicking C:\CanaryMod\start.bat
    • This is needed in order to create the initial configuration folders, etc.
  7. Stop the server by pressing Ctrl-c at the server console prompt
  8. Download the ScriptCraft jar file to the C:\CanaryMod\plugins folder
    • At this point you can start the server again but you may want to make the following additional configuration changes first
  9. Change or add the following configuration options in

    C:\CanaryMod\config\worlds\default\default_NORMAL.cfg

    ``` ; completely flat worlds are best for building from scratch world-type=FLAT generate-structures=false

    ; creative mode gamemode=0 pvp=false

    ; turns off authentication online-mode=false spawn-npcs=false spawn-monsters=false ```

  10. Add yourself to the list of ops (only ops can run javascript by default) by adding your player name to C:\CanaryMod\config\ops.cfg
  11. Delete the existing world that was generated on first start so that a new flat world is generated by removing the C:\CanaryMod\worlds folder (this is also a good way to reset a world)
  12. Start the server again by double clicking C:\CanaryMod\start.bat
  13. Connect using a Minecraft 1.8 client
    • Use the add server option to add a server with Server Address set to localhost
    • NB. If using an earlier version of Minecraft you may need an earlier version of CanaryMod too