Skip to content

Seattle CoderDojo

A Free Tech Meetup for Kids

Menu
  • 2023 Reboot
  • Teaching Kids To Code
  • Volunteers
  • Frequently Asked Questions
Menu

Minecraft Week 3 CheatSheet: The Drone Object

Posted on March 12, 2015March 13, 2015 by Greg Bulmash

In the workshop, Subarno demonstrated the Drone object. This a great helper library that comes with ScriptCraft and makes a lot of building tasks easy. It’s explained in a fair amount of detail in The Young Person’s Guide to Programming in Minecraft and in more extensive detail in the ScriptCraft API Reference.

For example, if you want to make a block of stone that is five bricks wide, five bricks high, and five bricks deep, you’d use the following command to invoke the drone.

box(1,5,5,5);

The first argument is the ID of the type of block. It can be a number like 1 for granite and 46 for TNT, or you can use one of the constants like blocks.oak. The following three numbers are the width, height, and depth. To make the same size shape, but hollow inside and open at the top and bottom, you’d use:

box0(1,5,5,5);

Subarno showed off a plugin he’d built called “My Fortress”. Here is the code for it…

function myfortress(){
	//set a checkpoint where we're starting
	//then build a square shape 10 blocks long per side and 5 blocks high

	this
	.chkpt('myfortress') 
	.box0(1,10,5,10)
	.up(2)

	for(var i = 1; i <=6; i++){
		 this.right(2)
		.box(102,1,1,1)
		.back
		if( i === 3 ) this.right(3).turn(3)
	}
	
	//return the drone to the starting point.
	this.move('myfortress');
};

var Drone = require('drone'); 

Drone.extend( myfortress );

Then there's Subarno's pretty fun Exploding Fortress...

function myExplodingFortress(){
	this.chkpt('myfortress');
	for ( var l = 0; l <= 4; l++){
  		this.box0(46,60,10,60)
		.fwd()
		.box0(51,1,1,1)
		.up(2)
	}
	this.move('myfortress');
}

var Drone = require('drone'); 

Drone.extend( myExplodingFortress );

And last, Subarno's mybase()

function mybase(){
	this.chkpt('mybase') 
	.box0(97,21,20,30)
	.right(11)
	.box(51,2,5,1)
	.back()
	.box(108,4,1,1)
	.fwd(10)
	.left(14)
	.move('mybase')
	.box(97,21,1,30)
	.move('mybase')
	.up(20)
	.prism0(97,21,30,30)
	.move('mybase');
}

var Drone = require('drone'); 
Drone.extend( mybase );

Upcoming Events

  • CANCELLED: SEATTLE CODERDOJO – March 7, 2020

  • CANCELLED: SEATTLE CODERDOJO – March 14, 2020

  • CANCELLED: SEATTLE CODERDOJO – March 21, 2020

Get News and New Ticket Notices

Join our mailing list. We not only won’t spam you, but you’ll probably complain we don’t mail you enough.

Support Seattle CoderDojo

Make a $5 or $10 donation - not tax deductible.
To make a larger donation ($20 or more) that IS tax deductible, follow this link.
©2023 Seattle CoderDojo | Design: Newspaperly WordPress Theme