Change mob movement range

Discussion in 'Plugin Development' started by Pik0, May 8, 2015.

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

    Pik0

    As many of you know, when no players are nearby a mob (16 blocks range i think), the mob just stops, and wont move until a player comes nearby. I am making a custom entity with custom pathfindings but it just messes when nobody is around. I searched in craftbukkit's code but i couldn't change this value or see the piece of code that checks this range.
     
  2. Offline

    Konato_K

    @Pik0 It's part of the generic attributes, the one you're looking for is GenericAttributes.b
     
  3. Offline

    Pik0

    @Konato_K that is not what i wanted, the attribute b its "generic.followRange" and that goes for the "targetting range" not the autonomous move range, like if i spawn a mob and i define his pathfinding, then i go like 50 blocks away, and i come back he is still in the same position, but he kicks moving the defined pathfinding when someone is nearby like 20 or 30 blocks, keep in mind that the mob is not targeting the player but the player is a sort of mob loader so he doesnt stop walking. This can't be a chunk loading issue because it is way to close to the chunk become unloaded.
     
  4. Offline

    Konato_K

    @Pik0 Ah, I see what you mean, and it sounds a bit weird, but I don't know what can be the problem in that case, sorry.
     
  5. Offline

    bohafr

    I think you can use spigot, in spigot.yml you can manage active range and tracking range,

    in code you can maybe set it if you have added spigot jar or you can check player move event - location, to nearby entities set movementspeed normal, to far entities set movementspeed 0
     
Thread Status:
Not open for further replies.

Share This Page