You put way too much effort in checking whether or not an item is selected, and not only that, you are creating a new class loader when you could have simply used the one created by OSBot itself. You need to retrieve two fields to check if an item is selected whereas I only need to retrieve one. Instead of just initializing the fields in the classes constructor you are using redundant if statements which is both inefficient and unconventional. You can use final a lot more in your code to clean it up and you could have just put the whole block of code in one try catch statement, you used two. Again, both inefficient and unconventional. You do not use a method provided by the client and instead you create your own way of doing it.
As for my code, it's not working as I haven't updated it which would literally take a second. As I said, the classloader is from a method provided by OSBot which is, indeed, obfuscated however efficient compared to your way of doing it. There's a certain field in the client which states whether or not an item is selected, using that the check is a whole lot more efficient and a whole lot cleaner. Just listen to what I say.