Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Mob detection range


Recommended Posts

Hi,

 

I have spent the last couple of days researching and trying to learn/figure out ways of dealing with changing the detection range on mobs.

 

I believe that this is handled through EntityMob, Specifically:

 

protected Entity findPlayerToAttack()

    {

        EntityPlayer entityplayer = this.worldObj.getClosestVulnerablePlayerToEntity(this, 16.0D);

        return entityplayer != null && this.canEntityBeSeen(entityplayer) ? entityplayer : null;

    }

 

I blieve there is also a pathing distance I will need to look in to as well.

 

Anyhow my question is: How in the world do I go about changing the aggro range on mobs. If my assumption is right then it is currently set at 16 according to entitymob. I could be entirely wrong I guess. (Zombies in 1.6 for example have an insane aggro range now and I am still looking to figure out why that is).

 

Any help or pointers in the right direction is greatly appreciated.

Link to post
Share on other sites

FollowRange is handled by the new Attribute system as of 1.6.

In EntityLivingBase there is func_110147_ax which I would translate as "initAttributes".

In EntityZombie it has this line:

this.func_110148_a(SharedMonsterAttributes.field_111265_b).func_111128_a(40.0D);

Which I would translate as:

getAttribute(SharedMonsterAttributes.followRange).setValue(40.0D);

Link to post
Share on other sites
  • 7 years later...
On 8/11/2013 at 9:34 PM, diesieben07 said:

FollowRange is handled by the new Attribute system as of 1.6.

In EntityLivingBase there is func_110147_ax which I would translate as "initAttributes".

In EntityZombie it has this line:

this.func_110148_a(SharedMonsterAttributes.field_111265_b).func_111128_a(40.0D);

Which I would translate as:

getAttribute(SharedMonsterAttributes.followRange).setValue(40.0D);

 

can u use this to modify followrange in a command block

 

Link to post
Share on other sites
Guest
This topic is now closed to further replies.


×
×
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.