|10 years ago|
|build||10 years ago|
|docs||10 years ago|
|mcp-deprecated||10 years ago|
|screenshots||10 years ago|
|src||10 years ago|
|.gitignore||10 years ago|
|README.md||10 years ago|
|build.local.properties.sample||10 years ago|
|build.properties||10 years ago|
|build.xml||10 years ago|
ScriptCraft is a plugin for Minecraft Servers which lets
operators, administrators and plug-in authors customize the game using
can be written in Javscript and can use the full Bukkit API. The
prompt. To bring up the in-game prompt press the
/ key then type
/js 1+1 will print
- echo( message ) - displays a message on the player's screen. e.g.
/js echo( 1 + 3 )or
/js echo ("Hello World")
- getMousePos() - A function which returns the current position of the cross-hairs (if a block is targeted)
- 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 (if no coordinates are given the block the player is currently looking at is replaced).
- getBlock( x, y, z ) - returns the blockId and metadata at the given location (if no coordinates are given the cross-hair location is used)
- 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
provides a much richer API which can be used to construct
buildings. See the attached cottage.js file for an example
of you can use the sample Drone plugin to create new buildings in
You will need to have Java version 6 or 7 installed on your
machine. Check the version by typing
java -version at a command
prompt. You will need to install Bukkit on your machine. Bukkit
is a version of Minecraft (server) that makes it easy to install
plugins and customize Minecraft. You can download the CraftBukkit
If you don't want to compile from source, you can download the compiled plugin here and copy it the craftbukkit's plugins directory.
Once installed, a new js-plugins directory is automatically created in
the same directory as the plugins folder. All files in the js-plugins
directory will be automatically loaded when CraftBukkit starts. Only
players who are ops can use this plugin. You can grant a player
privileges by typing 'op ' at the server console prompt or
by adding the player's username to the ops.txt file in your
Launch CraftBukkit, then launch the Minecraft client and create a new
server connection. The IP address will be
localhost . Once you've
connected to your bukkit server and have entered the game, look at a
ground-level block and type ...
/js up().box('35:15', 4, 9, 1)
__plugin- the ScriptCraft Plugin itself. This is a useful starting point for accessing other Bukkit objects. The
__pluginobject is of type org.bukkit.plugin.java.JavaPlugin and all of its properties and methods are accessible. For example...
self- The player/command-block or server console operator who invoked the js command. Again, this is a good jumping off point for diving into the Bukkit API.
server- The top-level org.bukkit.Server object. See the Bukkit API docs for reference.
ScriptCraft has its own website with further information.
- The ScriptCraft API documentation.
- To delve deeper into creating your own minecraft mod, I recommend reading this.
You can find more information about ScriptCraft on my blog.