BuddingDev Posted June 22, 2015 Posted June 22, 2015 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? Quote
jabelar Posted June 22, 2015 Posted June 22, 2015 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. Quote Check out my tutorials here: http://jabelarminecraft.blogspot.com/
BoonieQuafter-CrAfTeR Posted June 22, 2015 Posted June 22, 2015 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 Quote Im serious don't look at it!!
BuddingDev Posted June 23, 2015 Author Posted June 23, 2015 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 Quote
BoonieQuafter-CrAfTeR Posted June 23, 2015 Posted June 23, 2015 dude how are you spawning it? if your not spawning it serverside then it wont work. Quote Im serious don't look at it!!
Recommended Posts
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.