Mobs Immune to Arrows

Issue description

A feature to make mobs immune to arrows, it make arrows bounce on them, like in Wither Phase 2

Here a piece of code someone from Unofficial MCreator Discord provided

public boolean attackEntityFrom(DamageSource source, float amount)
{
    Entity entity = source.getImmediateSource();
    if (entity instanceof EntityArrow)
    {
        return false;
    }
    else
    {
        return super.attackEntityFrom(source, amount);
    }

 

Issue comments

Yeah, i will so that to all my bosses

Oh wait, Is this possible to immune mobs from sword? or hits with hand

MCreator 1.9.0 will add the option to make mob immune to the following new sources (each one can be enabled or disabled):

  • arrows
  • potions
  • direct player attack (hand, sword)
  • fall damage
  • cactus
  • drowning
  • lightning bolts

I am closing this ticket now.