Getting hostile mobs on horses to attack people

Discussion in 'Plugin Development' started by thebmanswan541, Dec 11, 2014.

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

    thebmanswan541

    Title explains it all. I do currently use nms in my plugins.
     
  2. Offline

    MisterErwin

    @thebmanswan541 My suggestion is to use custom PathfinderGoals.

    (Yepp, you have to set the target of the horse and the mounted entity)

    But there might be other ways
     
  3. Offline

    97WaterPolo

    @thebmanswan541
    Not sure if a hostile mob could actually damage a player while on a horse, but you might be able to do it via a runnable. Just have the horse target the nearest player and have a runnable every 20seconds and check if the player is near the hostile on the horse, and if they are use Entity#damage to attack the player.
     
  4. Offline

    CodingAddiction

    If you really want it to do that, you'll need this path finder goal: PathfinderGoalMoveTowardsTarget. At the same time, use the example above, from 97WaterPolo, and everything should work fine. If it doesn't work, reply with the error and we'll try to fix it.
     
    97WaterPolo likes this.
Thread Status:
Not open for further replies.

Share This Page