Setting A Zombie's Target (make it attack something)

Discussion in 'Plugin Development' started by Scyntrus, Dec 15, 2013.

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

    Scyntrus

    I would like to set a zombie's target and make it attack something. Specifically, I noticed that when a wolf attacks a zombie, the zombie doesn't attack back (PigZombies do though). I would like to make it defend itself when a wolf attacks it. Preferably, I would like to do something when an EntityDamageByEntityEvent is called. I know setTarget doesn't work, but in this case setGoalTarget also doesn't work. I do NOT want to create a custom entity for this situation, but I am okay with using NMS and reflection. Anybody have any idea?
     
  2. Offline

    xTrollxDudex

    Scyntrus
    You could add or edit the pathfinder goals in the zombie's NMS class
     
  3. Offline

    Scyntrus


    Zombie already has PathfinderGoalHurtByTarget.
    PigZombie doesn't have any more goals than Zombie, yet PigZombies have the desired behavior.
     
  4. Offline

    xTrollxDudex

    Scyntrus
    You're right 0.0

    Actually, what I did notice was that a zombie uses setGoalTarget in the damage something method. That means something.
     
  5. Offline

    Garris0n

  6. Offline

    Scyntrus

    In any case, changing those methods would require creating a custom entity class, which I don't want to do. It's starting to seem like this isn't possible.
     
Thread Status:
Not open for further replies.

Share This Page