Click here to Skip to main content
15,890,282 members
Articles / MineCraft

Build Giant Ravine in Minecraft using ScriptCraft (With Other Examples)

Rate me:
Please Sign up or sign in to vote.
4.00/5 (1 vote)
20 Feb 2015CPOL2 min read 9.9K   5  
Build Giant Ravine in Minecraft using ScriptCraft (With Other Examples)

Minecraft is a huge game. The full PC version is especially great because it is customizable with lots of mods available all over the internet. One great new mod is ScriptCraft by Walter Higgins (http://scriptcraftjs.org/). ScriptCraft runs on a bukkit version of the minecraft server. Installation is covered on the ServerCraft site.

ScriptCraft adds JavaScript control of minecraft. Buildings and other objects can be created instantly through the Minecraft command line. Also, this can be a great way to introduce someone into programming for the first time.

Try these samples below. Copy these JavaScript sources to your server and restart it to try them out.

Save as igloo.js and put in your js-plugins\drone folder.

JavaScript
load(__folder + "drone.js")
//
// constructs an igloo
//
Drone.extend('igloo', function () {
this.chkpt('igloo');
//make basic structure
this.hemisphere0(blocks.snow, 7, 'north');
this.right(2).down(2);
//clear door
this.back();
this.right(4);
this.up(2);
this.box(0, 2, 3, 2);
return this.move('igloo');
});

Run this by typing in the Minecraft command line:

JavaScript
/js igloo()

Image 1

Save as enchant_table.js and put in your js-plugins\drone folder.

JavaScript
load(__folder + "drone.js")
//
// constructs an enchantment table surrounded with books for max enchanting
//
Drone.extend('enchant_table', function () {
this.up(); //set to just above floor level.
this.box0(blocks.bookshelf, 5, 5, 4);
this.chkpt('enchant_table');
//open side
this.up().right();
this.box0(0, 3, 3, 1);
//add enchantment table
this.move('enchant_table');
this.up().fwd().right(2);
this.box(blocks.table_enchantment);
//add floor
this.move('enchant_table');
this.box(blocks.bookshelf, 5, 1, 4);
//add roof
this.up(4);
this.box(blocks.bookshelf, 5, 1, 4);
return this; });

Run this by typing in the Minecraft command line:

JavaScript
/js enchant_table()

Image 2

Now, you'll have an enchantment table that is fully maxed out.

One of my favorite things to do with this is to use the command to explore and reveal to the world underneath. So to clear out large areas in this snow covered forest, issue a command like down(height/2).box(blocktype, width, height, depth) with 0 for the block type.

Image 3

JavaScript
/js down(40).box(0, 20, 70, 120)

Image 4

Now just look at the giant ravine we've created. This method reveals all sorts of neat areas to explore and is great for mining.

The box(...) part of the function is what actually clears the area out since we are using air (block 0) as the block. Since box() always goes up, we need to send the command down with the down(40) command first. Since we are using JavaScript, we can chain the commands together as shown above.

What kind of cool things are you doing? Please send me a note if you've enjoyed this page.

Some of the ScriptCraft built in samples to try:

JavaScript
/js castle()
				/js chessboard()
				/js cottage()
				/js cottage_road()
				/js dancefloor()
				/js fort()
				/js rainbow()
				/js temple()

To create with other block types, use the (dec) values from the official Minecraft list: http://www.minecraftwiki.net/wiki/Data_values.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Chief Technology Officer WorxForUs
United States United States
I am a programmer who posts rambling on about java, Android, PHP, or whatever I am motivated to type on my charcoal colored Kinesis Freestyle2 keyboard. Please send +1's, shared links, warm thoughts of encouragement, or emasculating flames of internet fury to my blog. Thanks for reading!

righthandedmonkey.com

Comments and Discussions

 
-- There are no messages in this forum --