Controlling livingentity did not work

Discussion in 'Plugin Help/Development/Requests' started by TakaGo, Nov 22, 2014.

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

    TakaGo

    :'(I am trying moving a sheep with nms, but there's a big problem.
    see here.
    Code:java
    1.  
    2. @EventHandler
    3. void ontar(EntityTargetEvent event){
    4. event.setCancelled(true);
    5. }
    6.  
    7. @EventHandler
    8. void ontar2(EntityTargetLivingEntityEvent event){
    9. event.setCancelled(true);
    10. }
    11.  
    12. @EventHandler
    13. void oni(PlayerInteractEntityEvent event) {
    14. if (event.getRightClicked() instanceof LivingEntity) {
    15. LivingEntity le = (LivingEntity) event.getRightClicked();
    16. CraftLivingEntity l = (CraftLivingEntity) le;
    17. EntityInsentient en = (EntityInsentient) l.getHandle();
    18. Navigation na = en.getNavigation();
    19. na.a(0, 0, 10.0, .5);
    20. System.out.print("test");
    21. }
    22. }

    No err prints.The screen can print "test",but the sheep did’t move.
    PS.The server is running on spigot


    Yeah,the question has been solved,The reason is "na.a(0, 0, 10.0, .5);"
    This location should be the player's location.
     
Thread Status:
Not open for further replies.

Share This Page