itemID = 5; if (pinv.getCurrentItem() != null)
{if (pinv.getCurrentItem().itemID == itemID) {var ent = pinv.getCurrentItem(); player.swingMainHand();}}
if (pinv.getOffhandItem() != null) 
{if (pinv.getOffhandItem().itemID == itemID) {var ent = pinv.getOffhandItem(); player.swingOffHand();}}

if (hitBlock != null) {time.sleep(0.05); var blockID = world.getBlockID(hitBlock.x,hitBlock.y,hitBlock.z);
var blockMD = world.getMetadata(hitBlock.x,hitBlock.y,hitBlock.z);

if (blockID == 206 && blockMD == 9)
{pinv.consumeItemAmount(5,0,1); player.dropItem(Item(280,2)); crafting_xp += 0.2;
itemSearch = player.getEntitiesWithinRange(0.5); for (var i = 0; i < itemSearch.length; i++) {var ent1 = itemSearch[i]; 
if (ent1.getClassType() == "Item") {ent1 = ent1.setPosition(hitBlock.x + 0.5,hitBlock.y + 0.7,hitBlock.z + 0.5);}}}

var fireP = 32 + Math.sqrt(cooking_lvl+smithing_lvl); fireUP(fireP,itemID);}
itemUsed = true;