theishiopian Posted April 20, 2021 Posted April 20, 2021 (edited) This is a follow up to an earlier post about not being able to use the knockback method. Well, since then I've learned a bit more about the nature of my problem. It turns out that knockback DOES work, but the catch is if I cancel the LivingAttackEvent that I'm calling the code from, then all attempts to modify the velocity of the player are nullified, even if i extract the mojang knockback code and reuse it (which I don't want to do in the long run, for legal reasons). As soon as I stop canceling the event, the knockback works. Unfortunately, I NEED to cancel the event, since its the whole point of the mod. What could be causing this interaction??? Edited April 20, 2021 by theishiopian grammar Quote
theishiopian Posted April 20, 2021 Author Posted April 20, 2021 Absolutely! You're in luck, I have a git repo. I added comments in the problem section, the offending code is in EventHandler.java Repo: https://github.com/theishiopian/Parrying Quote
theishiopian Posted April 21, 2021 Author Posted April 21, 2021 Holy crap that actually worked! Thank you very much, I haven't seen hurtMarked documented or used anywhere! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.