Setting a target from far away

Discussion in 'Plugin Development' started by mine2012craft, Sep 2, 2017.

Thread Status:
Not open for further replies.
  1. Offline

    mine2012craft

    Hello,

    So my goal here is to try and set a mob's target when it is damaged by a player that is further than its follow range. I've tried "setTarget", "setGoalTarget", and setting it's navigation. All do not seem to work and still show that depressing "null" message when I check for the target.

    Is there any possible way to do this?

    Thank you,
    WarlordWeaponry
     
  2. The most simple way would be increasing the follow range of the mob that is supposed to follow the player.
    (use mob.getAttribute(Attribute.FOLLOW_RANGE).setBaseValue(distance + 5);
    //set his target
    Don't forget to decrease his follow range after he has found the player.

    The hard way is too manually guide the mob until the player is in his follow range.
     
Thread Status:
Not open for further replies.

Share This Page