if (timing > 4) {timing = 0; var damage; var repair = 4; var itemID = 2024; var maxDamage = 150;
if (pinv.getCurrentItem() != null && pinv.getCurrentItem().itemID == itemID) {var ent = pinv.getCurrentItem(); player.swingMainHand();}
if (pinv.getOffhandItem() != null && pinv.getOffhandItem().itemID == itemID) {var ent = pinv.getOffhandItem(); player.swingOffHand();}

if (hitBlock != null) {time.sleep(0.05); repairFun(repair,itemID,ent.damage);

if (blockID == 206 && (blockMD == 7 || blockMD == 6 || blockMD == 3 || blockMD == 2) && actD != -1) 
if (fireArray [actD] [1] [0] == hitBlock.x || fireArray [actD] [1] [1] == hitBlock.y || fireArray [actD] [1] [2] == hitBlock.z) {
	i = actD; if (fireArray [i] [2] < fireArray [i] [3]/4) {
		if (fireArray [i] [7] != 0) {
			for (jj = 0; jj < fireArray [i] [11]; jj++) {player.dropItem(Item(fireArray [i] [7]));} 
			if (fireArray [i] [9] == 6) {cooking_xp += Math.sqrt(fireArray [i] [3])/5;} 
			if (fireArray [i] [9] == 2) {smithing_xp += Math.sqrt(fireArray [i] [3])/5;}
			itemSearch = player.getEntitiesWithinRange(0.5); 
			for (ii = 0; ii < itemSearch.length; ii++) if (itemSearch[ii].getClassType() == "Item") {
				vec = player.getLookVec(); itemSearch[ii].addVelocity(vec.scale(-1/6));
				itemSearch[ii].setPosition(hitBlock.x + 0.5,hitBlock.y + 0.7,hitBlock.z + 0.5);
			}
		}
	} else if (fireArray [i] [8] != 0) {
		player.dropItem(Item(fireArray [i] [8])); itemSearch = player.getEntitiesWithinRange(0.5);
		for (ii = 0; ii < itemSearch.length; ii++) if (itemSearch[ii].getClassType() == "Item") {
			vec = player.getLookVec(); itemSearch[ii].addVelocity(vec.scale(-1/6));
			itemSearch[ii].setPosition(hitBlock.x + 0.5,hitBlock.y + 0.7,hitBlock.z + 0.5);
		}
	}

	fireArray [i] [2] = 0; fireArray [i] [3] = 0;
	if (ent.damage < 150) {blockHP = Math.max(blockHP-power,0); ent.damage += 1;} 
	else {pinv.consumeItem(itemID.maxDamage,1);}
	fireArray [i] [6] = ""; fireArray [i] [7] = 0; fireArray [i] [8] = 0; fireHP = 0; fireMaxHP = 0; fireburn = 0;
}
}}