Changing Wither behavior

Discussion in 'Plugin Development' started by xLoGiiKzZo, Sep 1, 2013.

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

    xLoGiiKzZo

    Hello,
    I'm trying to make Withers not attack certain players (using the target event does not work as they will still shoot at the player), would it be good to override the PathfinderGoalNearestAttackableTarget class and adding if statements after this line:
    https://github.com/Bukkit/mc-dev/blob/master/net/minecraft/server/PathfinderGoalNearestAttackableTarget.java#L41
    To check if the EntityCreature that was passed is a Wither, and checking if list.get(0) is equal to the players name that shouldn't get attacked, if it is, check if list.get(1) is not null, if its not, then set this.g to list.get(1)
    Would this work? Or would removing the vanilla mc PathfinderGoalNearestAttackableTarget from withers, creating a custom PathfinderGoalNearestAttackableTarget, and then adding that one to the wither be better?

    I tried my best explaining this, I hope you guys understood what I was trying to say.
     
Thread Status:
Not open for further replies.

Share This Page