Posted June 22, 201510 yr 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?
June 22, 201510 yr I have a tutorial on this as it is a common problem: http://jabelarminecraft.blogspot.com/p/minecraft-forge-1721710-custom-entity.html Hopefully one of the tips there will solve your problem. Check out my tutorials here: http://jabelarminecraft.blogspot.com/
June 22, 201510 yr 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!!
June 23, 201510 yr Author Well, I have tried these items, but still I cant get the entity to attack others. Also they disappear when the world is reloaded. Entity Class: http://pastebin.com/S7R4dYdj
June 23, 201510 yr dude how are you spawning it? if your not spawning it serverside then it wont work. Im serious don't look at it!!
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.