Setting where a LivingEntity looks at

Discussion in 'Plugin Development' started by Rprrr, Mar 18, 2013.

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

    Rprrr

    Hi,

    I would like to know how you can efficiently set where a LivingEntity looks at.

    Of course, I have experimented with setting the yaw and pitch. This, however, does not work. The LivingEntity seems to automatically look back at where it initially wanted to look - and that is not where I want it to look.

    I've even tried to set the navigation using NMS-code, but this results in a very buggy and slow way of doing it, so I'd prefer not going with that.

    Can anyone tell me how to do this? Thanks in advance!
     
  2. Offline

    Nitnelave

    You could do this by subclassing every livingEntity class you want to modify, catch the spawn event to replace the entities by your custom ones, and in the custom ones, replace the AI to set where they're looking at. But that may be a bit brutal for what seems to be a simple thing...
     
  3. Offline

    Rprrr

    Nitnelave
    Exactly. :s

    So, does anyone know a simpler way?
     
  4. Offline

    Nitnelave

    I don't think there is one, as there is no simple way to prevent a mob from moving...
     
  5. Offline

    Rprrr

    Nitnelave
    Alright.. I'll try to create a custom LivingEntity then.
     
Thread Status:
Not open for further replies.

Share This Page