Question How to stop mobs looking and following a player

Discussion in 'Bukkit Help' started by KoalaOnCaffeine, Jun 24, 2018.

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

    KoalaOnCaffeine

    Hi I was wondering how I can stop mobs from looking at and following certain players.
    I have made a vanish command so PLAYERS cannot see a specific player, but mobs still attack and damage the player, which gives away their location. I am working on them not taking damage I just cant work out how to stop the mobs from knowing the player is there.

    Thanks, any help is appreciated!
     
  2. Offline

    AlvinB

    Subscribe to the EntityTargetLivingEntityEvent, if the entity being targetted is one of your vanished players, cancel the event.

    As an alternative you could always put the player in creative/spectator mode, which will do the attack-cancelling automatically.
     
Thread Status:
Not open for further replies.

Share This Page