ScriptCraft

ScriptCraft

14.6k Downloads

How to attach a torch to a block

kellyfj opened this issue ยท 2 comments

commented

Can you please provide a code sample to attach a torch to a block?

I am creating a skyscraper but mobs appear and I would like to attach a torch every N blocks or so.
Just need a snippet / gist to show how to create a block then attach a torch to it

Thanks!

-Frank

commented

Now worries - I figured it out from this snippet in fort.js

torch = blocks.torch + ':' + Drone.PLAYER_TORCH_FACING[this.dir];
this
.move('fort')
.right((side/2)-1)
.door2() // double doors
.back()
.left()
.up()
.box(torch) // left torch
.right(3)
.box(torch); // right torch

commented

Hi Frank,

You can also use hangtorch(). The next release (3.0.3) will hopefully be out later today and fixes some issues with block placement in Minecraft 1.8

https://github.com/walterhiggins/ScriptCraft/blob/master/src/main/js/plugins/drone/contrib/hangtorch.js#L23-L43