Hi, I'm having a problem figuring out what to do to make my mob move faster. Any help would be appreciated!
I defined it as a creature, so i referenced EntityAIFindEntityNearestPlayer to make the mob come to the player and deal damage.
My problem is it comes to the player at a crawl, rather than quickly. I was wondering how to make it go faster? Is there another AI task i can use? If I get rid of this one, however, my mob will not follow the player. Here is my code:
public static class Entityboar extends EntityCreature {
World world = null;
public Entityboar(World var1) {
super(var1);
world = var1;
experienceValue = 5;
this.isImmuneToFire = false;
addRandomArmor();
setNoAI(!true);
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));
this.tasks.addTask(2, new EntityAIWander(this, 1));
this.tasks.addTask(3, new EntityAIAttackMelee(this, 0.5, false));
this.tasks.addTask(4, new EntityAIFindEntityNearestPlayer(this));
this.tasks.addTask(5, new EntityAISwimming(this));
this.tasks.addTask(6, new EntityAILookIdle(this));
this.tasks.addTask(7, new EntityAIEatGrass(this));
I do have that for my mob, but the variable does not apply to the task I made. It moves fine, but as soon as the entity detects a player it starts slowly crawling towards them. I was wondering if you could change the move speed of the task.
Check to make sure your mob has an attack target (getAttackTarget != null) if so, apply a modifier to the attribute. For a reference, I do this with one of my monsters here.
Also, you're targeting AI tasks need to be apart of the targetTasks list - not the normal tasks list. This could be the reason your mob is slowing down when targeting. You might not even need the above then.
Hi, I'm having a problem figuring out what to do to make my mob move faster. Any help would be appreciated!
I defined it as a creature, so i referenced EntityAIFindEntityNearestPlayer to make the mob come to the player and deal damage.
My problem is it comes to the player at a crawl, rather than quickly. I was wondering how to make it go faster? Is there another AI task i can use? If I get rid of this one, however, my mob will not follow the player. Here is my code:
You should use entity attributes for that, e.g:
Youtube | Website | Twitter
Hi, thanks for the response.
I do have that for my mob, but the variable does not apply to the task I made. It moves fine, but as soon as the entity detects a player it starts slowly crawling towards them. I was wondering if you could change the move speed of the task.
Check to make sure your mob has an attack target (getAttackTarget != null) if so, apply a modifier to the attribute. For a reference, I do this with one of my monsters here.
Also, you're targeting AI tasks need to be apart of the targetTasks list - not the normal tasks list. This could be the reason your mob is slowing down when targeting. You might not even need the above then.