Just a heads up, the isActiveItemStackBlocking method inside LivingEntity might be more useful for this case.
As for the events not firing, I'm not sure. What is your code, and what are you doing to test it? In some cases, LivingAttackEvent doesn't always fire on players (like if a player is in creative, I think).
In fact, it should actually be firing twice on players if I'm reading the code right... Wait nevermind, I think it only fires once. The code is just confusing.
It's all of use, thank you. I'm completely new to forge and minecraft modding and eclipse. When I last took fingers to keyboard to program in Java, NetBeans was the canine's unmentionables of IDEs ( or Notepad ) and it was 2001 [ I'm old ]
Just for the sake of extra help, When you import something to your mod code you can use eclipse to navigate to the package you imported something from.
Basically if you ever import something like blocks (and you automatically imported it) from the Minecraft source code, then you can go to where that import is at the top of the file and navigate through there by clicking and double clicking around.
Additionally, you can click on any method anywhere in the source code for minecraft or for forge and wait for it to highlight and then right-click (which brings up a very nice menu) and find where it is declared and also any instances of it in other files —along with other stuffs.
I hope this is of use!
Thank you, @Animefan8888. I knew it would be something simple that I'd missed. I wish it wasn't quite THAT simple but there we go. The universe has a dry sense of humour.
The code for minecraft entities, blocks, etc are all in forge, and that is on your computer. For external dependencies just look up their github.
If you don't know Java, or just an inexperienced programmer, diving into Forge with a complex idea isn't going to work out. Anyhow, implement something trivial, for example maybe a new zombie extension, to figure out the ins and outs of what you're working with.