Solved Hide a player from an entity

Discussion in 'Plugin Development' started by TheEnderCrafter9, Aug 23, 2017.

Thread Status:
Not open for further replies.
  1. Hi, I wonder how I can hide a player from an entity. I want to walk near a slime without getting hit by it (not touching it). I know that if the player is invisible it won't be targeted by the entity, but I can't do that since other people won't be able to see. Is there a way to just make the entity target another player? Maybe when I hit a player, it sets that player I hit to the entity's target? I don't think that will be efficient since the entity might go back to targeting me.
     
  2. @TheEnderCrafter9
    EntityTargetLivingEntityEvent, and when the entity being targeted is your player, just cancel the event or set the target to null?
     
  3. @AlvinB How would I change the entity target when spawned? Call an EntityTargetLivingEntityEvent? Should I make the target null in the constructor and then call the setTarget() method, or just use the target in the constructor?
     
    Last edited: Aug 24, 2017
  4. Offline

    ThePandaPlayer

    @TheEnderCrafter9
    You could call a hidePlayer() method, but this might only work for other players.
     
Thread Status:
Not open for further replies.

Share This Page