Can't Set a Mob's Pitch!

Discussion in 'Plugin Development' started by Side8StarLite, Apr 22, 2017.

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

    Side8StarLite

    Hi
    I've already tried tons of approaches to this, but none seem to work.
    I have a pet that follows a player around, but I don't want its head to move up or down. Really, it should be simple, but none of what I try worked yet.

    1 - A BukkitRunnable that sets the pet's pitch by teleporting them to their own location + setDirection.
    2 - A BukkitRunnable that sets the pet's pitch by teleporting them to their own location + setPitch.
    3 - A custom mob, and getting rid of PathfinderGoalLookAtPlayer and other stuff that might make the pet look around on its own.

    The first two "work", but jitters horribly, and sometimes doesn't even set the pitch at all, maybe because of its AI. The problem is, if I setAI to false, I can't get it to move towards the player. I can't even get the third to work, because everytime I spawn the custom entity in, it doesn't appear. Particle effects fly when their feet hits the ground, but nothing shows up, not even in spec mode.

    And I haven't gotten around to this either, but if anyone can help, I need the pet to not attack the player (it's a Zombie :\).

    Please help - this has been bothering me for days, and my ocd can't stand it!
     
  2. Offline

    Horsey

    I dunno about the pitch problem, but to prevent the zombie from attacking players, here's some psuedo code

    EntityTargetEvent
    Check if entity is a zombie
    Check if entity is targeting a player
    Set Event Cancelled
     
  3. Offline

    Side8StarLite

    @Horsey
    Hi thanks for the reply!
    Yes that sounds like a great idea, but I'd prefer the zombie to not approach the player at all, so it doesn't end up rubbing its face against the player the whole time :pp.
     
  4. Offline

    Horsey

    @Side8StarLite I believe that the method I suggested would trigger every time a zombie starts to follow a player, so if you cancel it, the zombie would just not see the player
     
  5. Offline

    Side8StarLite

    @Horsey Oh lol I didn't see the 'Target' part. Thanks for the info!
     
  6. Offline

    Zombie_Striker

    @Side8StarLite
    If your problem has been solved, mark this thread as solved.
     
Thread Status:
Not open for further replies.

Share This Page