public ItemStack onItemUseFinish(ItemStack stack, World worldIn, EntityLivingBase entityLiving)
Entity entity = ModMath.getMouseOver(Minecraft.getMinecraft().getRenderPartialTicks(), 0); // Gets entity that entityLiving is looking at
if (entity != null && entity instanceof EntityLiving)
Using item that has the implementation of the method above doesn't damage entity. Debugging it showed that attackEntityFrom() is called, code within if statement is executed but entity isn't attacked. I looked into Minecraft's files that use attackEntityFrom() and observed that they just call attackEntityFrom(), just one line of code(I assume that something else that can affect entity attacking process was called before attackEntityFrom() in that files). How can I solve this problem? How can I deal damage to entity?
Objects, inheritance, overriding, methods, variables, singletons, event driven design, and probably a bunch more.
"Learning how to search for answers" being a very valuable tool regardless of what language you're working with (for instance, I see and vote-to-close-as-duplicate "I got this error it said something about null references?" question on Stack Overflow about twice a day).