I am trying to get an event that returns the held item and the entity the player right clicked on. Currently, the event is fine, but testing if the item extends from ItemShears doesn't work. It returns true for the vanilla shears though. My custom shears do extend from ItemShears and are registered correctly. They actually shear sheep and can break shear-able objects faster. So the shears themselves aren't broken.
ItemShears.class.isAssignableFrom(itemstack.getItem().getClass())
//or, use the better suited isInstance() method
ItemShears.class.isInstance(itemstack.getItem())
This is superfluous however, since you know the class you can simply use instanceof.
I am trying to get an event that returns the held item and the entity the player right clicked on. Currently, the event is fine, but testing if the item extends from ItemShears doesn't work. It returns true for the vanilla shears though. My custom shears do extend from ItemShears and are registered correctly. They actually shear sheep and can break shear-able objects faster. So the shears themselves aren't broken.
Any help would be greatly appreciated.
You have the comparison backwards. Use
This is superfluous however, since you know the class you can simply use instanceof.
Putting the CENDENT back in transcendent!
Oh! didn't realize that instanceof could be used there. (should use that more often). Thanks for the help!