Mobs are applying poison on collision rather than on attack
Funwayguy opened this issue ยท 2 comments
This may not seem like a big deal but this bypasses invincibility frames on the player as well as applying effects to entities even if the mob isn't hostile to them. Please use vanilla Cave Spiders as a reference on how to properly set this up, i.e. checking first if the attack was successful then applying the potion side effect.
Known affected mobs:
- EntityWasp
- EntityScorpion
- EntityCentipede
In addition to potion effects, other mob abilities such as the Scorpion's grab attack, apply on collision also bypassing attack cool downs and hostility checks. These should be preferably moved to 'attackEntityAsMob()' as well
I'll ignore the comment about the Spiders thanks.
Instead of applying the poison to the mobs collision, I will move it to an AI class and re-write the 3 year old code that is used on these mobs ;)