Custom Mob Behavior (Walking within specific Regions)

Discussion in 'Plugin Development' started by Jatoc, Jun 10, 2013.

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

    Jatoc

    I basically want to spawn a custom mobs that will act like normal mobs (zombies/skeletons), but stay within a specific region. I've been looking at related tutorials, but I'm still a little lost on how I should go about doing this.

    I've looked at:
    http://forums.bukkit.org/threads/tut-making-a-livingentity-walk-to-a-specific-tile.139086/
    http://forums.bukkit.org/threads/tutorial-how-to-customize-the-behaviour-of-a-mob-or-entity.54547/
    http://forums.bukkit.org/threads/make-mobs-go-to-a-location.149929/
    ===
    http://forums.bukkit.org/threads/li...neration-npc-library-1-5-2-compatible.110304/


    kumpelblase2, Jacek, Ivan
    (hopefully one of you can help!)

    I would like to use kumpelblase2's api if needed, but on the other hand, I don't know how often his api will be updated and I don't want things to break. If someone can guide me in the right direction, I would appreciate it!
     
  2. Offline

    Jacek

    I don't know which part you are having trouble with exactly but you need to put a check in where the mobs move making sure the to location is inside the region, if it is reverse the direction or something.
     
  3. Offline

    Jatoc


    Would I do this by setting up a onEntityMove custom event, or would I put the check into a custom Pathfinding?
     
  4. Offline

    Jacek

    That would be up to you I guess, the event would be called a huge number of times though so it might be an idea to avoid that.
     
  5. Offline

    Ivan

    I think the best thing you can do is customize the strolling. Extend the random stroll pathfinder. Override the method where it generates the coordinates. Let it generate a new set of coordinates if the target coordinate is outside the bounding box of the area and boom your done.
     
    Jatoc likes this.
  6. Offline

    Jatoc

    Thanks. THatd what I did. Also how does the priority system work? Do lower priorities get executed more often?
     
  7. Offline

    Ivan

    I think it works like this:
    It starts with the ones from priority 1. If none of them claimed the walking system by returning true (as seen in my tutorial), it'll go to the second one. When a pathfindergoal returns true, It'll ignore all the other goals.
     
Thread Status:
Not open for further replies.

Share This Page