Mob player tracking/follow range and bat AI

Discussion in 'Plugin Help/Development/Requests' started by SkittyBoat, Apr 14, 2015.

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

    SkittyBoat

    Hello ppl, this is my first post!

    I'm not to shabby when it comes with techy stuff but one thing I've not been able to figure out yet (mostly due to possible terminology conflicts when using google) is how one would go about adjusting the range at which a hostile mob entity becomes aware of a player and begins to track them!

    I'd like to be able to modify the distance at which a hostile mob entity begins to follow or track a user, but I've not been able to find a simple means of accomplishing this.

    Would anyone be so kind as to point me in the right direction(s)?

    E,G. I'd like to adjust how far away a zombie or skelington would be before its AI notices the player within its vicinity and attempts to viciously annihilate the player ^^

    Oh, just remembered. I'm not sure if I should create a separate topic, I'd not want to spam this forum with my questions.

    But would anyone know if any plugin developer has attempted to change the behavior of bats?
    On my server I have them spawning in the overworld with creepers riding on their back.

    Bats usually just sort of fly around aimlessly which isn't very fun in this situation and I figure it would be interesting if their behavior could be modified to actually track a user near them and head in for a kill when they have a creeper riding them, sort of like a little kamikaze in the minecraft world!

    I figure if this isn't something someone has done, maybe I could write a plugin for this.

    Something like a bat with an invisible creeper, and it tries to get near you and blow up lol, or invisible bat with visible creeper.
     
    Last edited by a moderator: Apr 14, 2015
  2. Offline

    mine-care

    @SkittyBoat I have no idea to be fairly honest but some really experienced coder might be able to help, for example @AdamQpzm and a few more, that can make a custom plugin
     
  3. @SkittyBoat Are you yourself a developer? The fact that this thread is in "Bukkit Help" suggests that you are not, but people have posted in the wrong section before, and this is your first post :) If you aren't a developer, then you will need to find someone who would be willing to make this plugin for you, although something like this sound like it's probably already available. I would suggest you look in the "Plugin Requests" section. If you are a developer, then:

    For the increasing of the range, it's actually a fairly simple thing - you'll need to look into overriding the default entities with NMS. There are some tutorials in the Resources section. For the customising the bat movement... I'm less sure about. I know that mobs such as Zombies you can make a pathfinder yourself, but when it comes to aerial mobs such as bats, I don't think the same thing applies. I might be wrong, but that's what I remember.
     
  4. Offline

    SkittyBoat

    You're absolutely right. I am in the wrong forum.... I just actually noticed this. Awkward..

    I spent some time googling and stumbled into a few threads discussing the usage of NMS.
    It does feel like what I asked should be out there, sounds like something someone must have already tried!

    I figure since bats are attracted to caves when they are near them, than they do in fact have some form of path finding AI and I'm curious if it's possible to re-write something to make them target a player instead of the cave :)

    I'll keep looking, and yes I am in the wrong forum.. Sorry about that. :s

    I just spent some time brushing up on what I already knew of Java to create another simple craftable exploding arrows plugin and I think I'll attempt to tackle understanding NMS and how to use it correctly.
     
    Last edited: Apr 15, 2015
  5. Offline

    Konato_K

    @SkittyBoat In my personal experience, bats can't be controlled in the exact same way as other mobs (or maybe I just went crazy back then).

    Anyway, this may help, look at the part of the generic attributes, one of them is the tracking stuff, but I'm not sure if that can work properly with bats.
     
  6. Offline

    SkittyBoat

    Ahh, yes.

    I had stumbled into this earlier but had problems with dependencies, I referenced the craftbukkit 1.8 r1 jar successfully this time. Thank you.

    Now that I got this past me I can begin playing with mobs AI and see if there is anything I can do for bats.

    After reading further on the other issue, the follow range, I see now this may not have been such a great idea due to lag issues. So I guess I wont do anything with that.

    Still, any help with changing a bats path finding from caves to players would be greatly appreciated!

    Who wouldn't love to be thrown in a world with violent flying kamikaze bats exploding around you at night! Still would love to make them follow a player, and from a far distance too so that a player could see they're in for some trouble as they approach.

    Edit: I see now that bats actually don't try and go into caves when spawned above ground, I don't remember what I read that said they do.. This suggests they don't have an path finding AI... Seems this will definitely not be an easy task.
     
    Last edited: Apr 15, 2015
Thread Status:
Not open for further replies.

Share This Page