From 7eea0c2530a92c96c559cd128d8e1b0577ae6fbc Mon Sep 17 00:00:00 2001 From: Walter Higgins Date: Thu, 27 Dec 2012 12:40:00 +0000 Subject: [PATCH] Update README.md --- README.md | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index c6da0b8..5021505 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,32 @@ ScriptCraft =========== -A Minecraft mod that lets you build using Javascript \ No newline at end of file +A Minecraft mod that lets you build using Javascript + +Description +=========== +The ScriptCraft mod lets you enter javascript commands at the in-game prompt. +To bring up the in-game prompt press the `/` key then type `js ` followed by any javascript statement. +E.g. `/js 1+1` will print 2. +ScriptCraft uses Rhino (The built-in javascript interpreter that comes with current versions of Java). +Unfortunately, due to the need to reobfuscate the Minecraft codebase , it is not possible to expose the entire +Minecraft Java API via Javascript as this goes against the current terms of use for MCP (Minecraft is not open source). + +As of Dec 27 2012, the ScriptCraft mod includes just a few built-in objects and functions to make building easier. + + * player - the Player object - unfortunately this isn't currently useful as its properties are obfuscated. + * world - The minecraft world object - again - all properties are currently obfuscated. + * getMousePos() - A function which returns the current position of the cross-hairs (if a block is selected) + * getPlayerPos() - A function which returns the current position of the player. + * putBlock(x,y,z,blockId,metaData) - A function which lets you place a block anywhere + * putSign(String[] texts, x,y,z,blockId, metaData) - A function which lets you place a sign. + +The above primitives can be used to create buildings which would otherwise be time-consuming to create manually. +It is highly recommended using the attached drone.js javascript module which provides a fluent API for building. + +Prerequisites +============= +You'll need to install the Minecraft Coder Pack and be comfortable installing a Minecraft Mod. +You can get the Minecraft Coder Pack here... + +http://mcp.ocean-labs.de/index.php/Main_Page