Solved MoveEvent doesn't work.

Discussion in 'Spigot Plugin Development' started by UglyDiaper, Jun 12, 2016.

  1. Hey, im working on a plugin but my move event doesnt work, there are no errors in the console and i cant find the problem, please help me.
    (And yes, the event is registered in the onEnable)


    MoveEvent code:
    Code (Text):

    public class MoveEvent implements Listener{

     
       public void onPlayerMove(PlayerMoveEvent e){
         if(main.fire.contains(e.getPlayer().getName())){
           e.getPlayer().sendMessage("m"); //  <--- To check if the event works, it didn't
           e.getPlayer().playEffect(e.getPlayer().getLocation(), Effect.MOBSPAWNER_FLAMES, 275);
         }
       }
     
    }
     
     
  2. You need to add a @EventHandler above the method.
     
    • Winner Winner x 1
  3. Did you register your event?
     
  4. By the way, PlayerMoveEvent triggers very often. This might lag your server.
     
  5. Omg... how did i not see that... i'm so stupid....
    Thanks for the reminder!