Koward Posted May 22, 2017 Posted May 22, 2017 (edited) Hello, I would like to edit the way attack is done in EntityLivingBase#attackEntityFrom(DamageSource source, float amount). I could cancel LivingAttackEvent and apply the effects myself, but obviously the return value of attackEntityFrom would always be false which could break many parts of the game. If instead of always returning false, we could set the return value via a result of the event, it would allow us that kind of modification. So, to quote the doc, instead of "If this event is canceled, the Entity does not take attack damage." it would be "If this event is canceled, no more computation is done. the Entity does not take attack damage. If the result is DENY, the Entity did not take attack damage". A DEFAULT to false would not break existing mods. Edited May 22, 2017 by Koward Quote
Alpvax Posted May 24, 2017 Posted May 24, 2017 I'm not quite sure why you want this. What are you trying to achieve? Quote
Koward Posted May 30, 2017 Author Posted May 30, 2017 (edited) I would like to change the base knockback applied when you punch a mob (without any item). There's no way to change that at the moment. I tried a work around applying a "reverse knockback", but has it depends on random values sometimes the knockback would still happen or only the reverse one, resulting in "pulling" the mob towards the player. There are also other mechanics in this method that could be useful for some modders. Edited May 31, 2017 by Koward 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.