This tutorial assumes you are familiar with Minecraft and have a login already ($25). Like many Minecraft mods, it's a little buggy, but give it a try. This has been tested on OS 10.9 with Minecraft v1.7.4. Background on this tutorial can be found here.
Download and install Minecraft, and get a login. Then follow the instructions here to install CraftBukkit and the latest Scriptcraft .jar.
The basic steps are:
Create a folder for your work called CraftBukkit.
Download the latest version of craftbukkit.jar to your folder.
In a code editor, paste a 3-line script starting with "#!/bin/bash..." Make sure the craftbukkit.jar filename matches the one you downloaded. Save that to your CraftBukkit folder as start_server.command.
Allow this script to run by opening a Terminal window and typing chmod a+x (leave a space at the end), then dragging the start_server.command file into Terminal, and only then hitting return.
Double-click on the start_server.command file to build the appropriate files for your CraftBukkit directory.
Download ScriptCraft.jar and move it to CraftBukkit > plugins. (As of 2014-01-04, the last working version is 2013-12-29; 2014-01-02 throws an error.)
op any username you want to give access to ScriptCraft. Or open the ops.txt file in a code editor and add your username (and any others who will play) to give you all JavaScript privileges on the server.
Type stop and the enter key in Terminal.
Open Minecraft, login. Choose Edit Profile and make sure to select the version that matches your version of craftbukkit (currently 1.6.4).
Click Play (if you're updating, it might take a while to download). Then click Multiplayer, Add server.
Start the Bukkit server by double-clicking on start_server.command in your Finder window. This will open a Terminal window; keep it open for now. After you quit Minecraft, type stop at the ">" prompt and hit enter, then quit Terminal.
(You can open Minecraft or the server first, order doesn't matter as long as you refresh server directory.)
Want others to play along? When you type Add Server, add your IP followed by :25565 (the default Minecraft port).
Then download and launch Port Map. (Make sure no other servers are using that port when you launch it.)
Launch Minecraft v1.7.4
Click 'Multi-Player'
Click 'Add Server'
Type any name you like in the name field then type localhost in the address field. localhost is a special internet address that points to your own computer.
Click 'Join Server' to join the craftbukkit server.
Once you've joined the game, press the / key located at the bottom right of your keyboard. A prompt will appear. Type the following then press enter:
If the number 2 is displayed, you're running JavaScript on Minecraft! In general:
The landscape of Minecraft is fun to explore; you can use the WASD keys to navigate. But Minecraft is not without dangerous creatures that can attack you. While not normally permitted in the game, you can use JavaScript to enable you to fly and stay out of harm's way. Just type this:
Now hit the spacebar twice to fly, shift to descend.
Making a block is easy. Just point yourself at a place in the landscape (a black rectangle will highlight it) and type this:
You should see a wooden block. If you want another material, click on the chart and change 5 to the integer id for another material (or look them up online). Avoid (13) cobblestone or sand (12), because they tend to fall down. Here are some for you to try:
Scriptcraft offers two ways to make a bunch of boxes at a time. If the entire construction is just a big rectangular box itself, you can use this formula:
depth is how far back it goes in space, not how far down into the ground it goes. Except for material, each of the other parameters is just the number of blocks in the x, y, and z directions. Here are some examples to try:
With box0, Scriptcraft gives you a convenient method for creating a hollow box, such as a house. Here's a wooden house that's 20 blocks wide, 10 high, and 20 deep.
You can make more irregular shapes by chaining together special Scriptcraft commands like fwd, up, right, and left.
The function move("start") will get you back to the starting place.
While Scriptcraft seems to require every script be written on a single line, you can write more complex functions and save them in an external script file like step.js. Then, in the Finder, just copy your script into the CraftBukkit > js-plugins folder, and in Minecraft type /reload and enter to update any changes.
Scriptcraft can be used to script interactions among players, such as a snowball game. Here's a simple example: