var itemID = 2098; var damage = 0;

if (hitBlock != null && getBlock != null && timing > 4
&& (world.getBlockID(getBlock.x, getBlock.y+1, getBlock.z) == 51 ||
(world.getBlockID(getBlock.x, getBlock.y, getBlock.z) == 206
&& world.getMetadata(getBlock.x, getBlock.y, getBlock.z) == 3)))
{time.sleep(0.05); timing = 0; pinv.addItem(Item(2099));
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();}} pinv.consumeItem(2098);}

if (timing > 4 && pinv.getSlotContainingItem(259) != -1) {timing = 0;
pinv.addItem(Item(2099));
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();}}
pinv.consumeItem(2098); slot = pinv.getItemInSlot(pinv.getSlotContainingItem(259)); slot.damage += 1;}