Jump to content

[1.7.10][Unsolved]Entity does not attack


BuddingDev

Recommended Posts

So, as stated, my custom entity does not attack others as specified.

I have heard that the entity has to override some thing. Is that true?

 

this.tasks.addTask(1, new EntityAIAttackOnCollide(this, EntityMob.class, 1, true));

So this line tells the entity to attack Mobs right?

Link to comment
Share on other sites

so yeah u have that AI but it still wont attack unless you are specific about what mob you want it to attack plus, if you are extending off a type golem or something you might want to use this to make the mob attack.

 public boolean attackEntityAsMob(Entity entity)
    {
        this.worldObj.setEntityState(this, (byte)4);
        boolean flag = entity.attackEntityFrom(DamageSource.causeMobDamage(this), (float)(10 + this.rand.nextInt(15)));

    }

 

also look into irongolem code or vanilla code

Im serious don't look at it!!

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.