Jump to content

Ranged mob not updating it's aim?


Recommended Posts


So I currently have a ranged mob, which will fire at me and then fire in that direction 5ish times before deciding to change it's direction and fire at me again. It repeats this at all times.



public class EntityBoomer extends EntityMob implements IRangedAttackMob {

private EntityAIArrowAttack aiArrowAttack = new EntityAIArrowAttack(this, this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue(), 20, 60, 15.0F);


public EntityBoomer (World par1World) {


    float moveSpeed = 0.45F;

    this.tasks.addTask(7, new EntityAIArrowAttack(this, this.getEntityAttribute(SharedMonsterAttributes.movementSpeed).getAttributeValue(), 20, 64.0F));   

        this.tasks.addTask(1, new EntityAISwimming(this));

        this.tasks.addTask(2, new EntityAIRestrictSun(this));

        this.tasks.addTask(5, new EntityAIWander(this, moveSpeed));

        this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));

        this.tasks.addTask(6, new EntityAILookIdle(this));

        this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false));

        this.targetTasks.addTask(2, new EntityAINearestAttackableTarget(this, EntityPlayer.class, 0, true));

this.setSize(0.6F, 2.3F);

// TODO Auto-generated constructor stub



protected String getLivingSound(){

return "eternisles:BoomerLiving";



protected String getDeathSound(){

return "eternisles:BoomerDeath";



protected String getHurtSound(){

    return "eternisles:BoomerHit";




    public void onLivingUpdate(){





    protected void entityInit()



        this.dataWatcher.addObject(16, new Integer(5));




public void applyEntityAttributes(){











  public boolean isAIEnabled()


        return true;





public void attackEntityWithRangedAttack(EntityLivingBase var1, float f){


        EntityBoomerBallvar2 = new EntityBoomerBall(this.worldObj, this, 4.0F);



        this.playSound("random.bow", 1.0F, 1.0F / (this.getRNG().nextFloat() * 0.4F + 0.8F));








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.

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.


  • Create New...

Important Information

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