下面先举一个栗子
Block.defineBlock(233,"test block 1",[["furnace",3]],50,false,0);
Block.setRedstoneConsumer(233, true);
Item.setCategory(233, ItemCategory.TOOL);
Player.addItemCreativeInv(233, 1, 0);
Block.defineBlock(234,"test block 2",[["furnace",3]],50,false,0);
Block.setRedstoneConsumer(234, true);
Block.setRenderLayer(234, 1);
Item.setCategory(234, ItemCategory.TOOL);
Block.setShape(234,1,0,1,0,0.99999,0);
Player.addItemCreativeInv(234, 1, 0);
function redstoneUpdateHook(x, y, z, newCurrent, someBooleanIDontKnow, blockId, blockData){
var powered = newCurrent;
if(blockId==233&&powered>=1&&powered<=15){
setTile(x,y,z,234);
}
if(blockId==234&&powered==0){
setTile(x,y,z,233);
}
}
Block.defineBlock(233,"test block 1",[["furnace",3]],50,false,0);
Block.setRedstoneConsumer(233, true);
Item.setCategory(233, ItemCategory.TOOL);
Player.addItemCreativeInv(233, 1, 0);
Block.defineBlock(234,"test block 2",[["furnace",3]],50,false,0);
Block.setRedstoneConsumer(234, true);
Block.setRenderLayer(234, 1);
Item.setCategory(234, ItemCategory.TOOL);
Block.setShape(234,1,0,1,0,0.99999,0);
Player.addItemCreativeInv(234, 1, 0);
function redstoneUpdateHook(x, y, z, newCurrent, someBooleanIDontKnow, blockId, blockData){
var powered = newCurrent;
if(blockId==233&&powered>=1&&powered<=15){
setTile(x,y,z,234);
}
if(blockId==234&&powered==0){
setTile(x,y,z,233);
}
}