ScriptCraft lets you create your own mods using Javascript. ScriptCraft uses the CommonJS module system (the same module loading system used by Node.js) so managing your code will be easier. You can also run Javascript code on the in-game command prompt or extend the game by writing plugins that use the Bukkit API in javascript.
Examples:
At the command prompt type:
/js 1 + 1
> 2
... Any javascript code can be evaluated at the in-game command prompt.
/js alert( 'Hello ' + self.name )
> Hello walterh
... Special bukkit variables are available via javascript , for example the server
object is the instance of org.bukkit.Server . Writing event handlers in ScriptCraft is relatively easy...
events.blockBreak( function( event ) {
echo(event.player, 'You broke a block!' );
});
events.playerJoin( function( event ) {
echo( event.player, 'Welcome to the server!' );
});
... Any bukkit event can be handled. The above code prints the name of any player who breaks a block in the game. ScriptCraft comes with some built-in functions to make building easier...
/js box( blocks.wool.black, 4, 9 , 1)
... creates a 2001 Monolith 4 blocks wide by 9 blocks high by 1 block long.
The full bukkit API can be used via javascript to write new mods. Yes - you can write bukkit plugins in javascript! See ScriptCraft on GitHub for more information. Full documentation is available on the github docs page.
A Youtube Video demonstrating Exploding Arrows in ScriptCraft A Youtube video demonstrating a mini-game (SnowBall Fight)