I was unable to find complete step by step instructions on how to do this. The available ones assumed one knew something about any of this first so getting it setup involved lots of searching. Here's what we did to get it running on a Windows 7 64-bit system. We used these instructions as a starting point.
1. Download Buildtools from https://hub.spigotmc.org/jenkins/job/BuildTools/lastBuild/
2. The Java 8 JDK may need to be installed. It's available at http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
We chose the Windows x64 version and installed it.
3. Git for Windows needed to be installed. It's available at https://git-for-windows.github.io/
4. We put buildtools.jar into a directory called spigot under program files and from a command prompt ran java -jar buildtools.jar against it. This created a jar file called spigot-1.11.2.jar.
5. Run java -jar spigot-1.11.2.jar - this creates a eula.txt file that must be edited. Change eula=false to eula=true
6. Run the spigot jar file again. It should do things and stop at a > prompt awaiting input. This is a multiplayer Minecraft server. Type stop to shut it down.
7. Download scriptcraft.jar from https://scriptcraftjs.org/download/latest/ and put it in the spigot plugins directory and restart spigot.
8 At the spigot server prompt, type op minecraftusername because running javascript from the minecraft client requires elevated privileges.
9 From the minecraft client, type /js 1+1 If you get 2, its working.
10. Download Codefosters js files from https://github.com/codefoster/javascript-minecraft-mods and put them in a safe place that is backed up.
11. Create a hard directory link. Run cmd.exe as administrator. Then type mklink /J e:\"program files"\spigot\scriptcraft\plugins\code (The backed up location of your javascript files from previous step)
12. Test using /js wool() within the Minecraft client to see if the hard link is working.
Helpful commands
/time set 1000 (to reset the time of day to morning)
/js refresh() (after changing code to refresh so the client sees changes)
This usually happens...
My son was continually typing give username ladder and give username sword, etc, so I thought it would be a simple process for him to create his first javascript function to minimize the typing of the username.
So, after he struggled with it for several minutes, I tried to create a function for give. After many hours, this was the best I could come up with, primarily from https://github.com/walterhiggins/ScriptCraft/blob/master/docs/API-Reference.md.
exports.j_give(j_item)
{
var inventory = require('inventory');
var items = require('items');
var utils = require('utils');
eval("utils.players(function(player){ inventory(player) .add( items.j_item(1) ) });");
}
The problem is that .add(items. takes the name of the item, like .add(items.cookie(1) for example. I tried a few different ways to pass in the value from j_item so it could be specified in the Minecraft client like.
/js j_give('cookie') for example, but was not able to get it to work. The function worked if cookie was hard coded as in
utils.players(function(player){ inventory(player) .add( items.cookie(1) ) });
Oh well - now he's working on a build castle function.