Posted July 5, 20187 yr How would I go about making my mob deal damage back to the attacker when hit.
July 5, 20187 yr Author Thanks, but the attacker now takes the damage and the mob does not take any damage. How do I change this? https://pastebin.com/jX8NZV0x ^code Edited July 5, 20187 yr by ChaoticSoul
July 5, 20187 yr The attackEntityFrom() method is responsible for actually doing the damage too. You still need to call super.attackEntityFrom(...) to keep the original behaviour (and you probably want to return the return value of that call from your overridden method). (Also, you didn't annotate getEntityAttributes() with @Override - please don't get into that habit; it's guaranteed to come back and bite you sooner or later). Edited July 5, 20187 yr by desht
July 5, 20187 yr Author 8 minutes ago, desht said: The attackEntityFrom() method is responsible for actually doing the damage too. You still need to call super.attackEntityFrom(...) to keep the original behaviour (and you probably want to return the return value of that call from your overridden method). (Also, you didn't annotate getEntityAttributes() with @Override - please don't get into that habit; it's guaranteed to come back and bite you sooner or later). Thanks! Works perfectly now.
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.