@Override
public void onUpdate(ItemStack par1ItemStack, World par2World, Entity par3Entity, int par4, boolean par5) {
if (!(par3Entity instanceof EntityPlayer))
return;
EntityPlayer player = (EntityPlayer) par3Entity;
ItemStack currentStack = player.getCurrentEquippedItem();
if (currentStack == null || !(currentStack.getItem() instanceof IAdvancedTool))
return;
IAdvancedTool tool = (IAdvancedTool) currentStack.getItem();
if (tool.getType().equals("sword"))