Plugin don't working

Discussion in 'Spigot Plugin Development' started by Kuba1001PL, Jun 15, 2016.

Thread Status:
Not open for further replies.
  1. It is my code:

    Code (Java):
    public class Main extends JavaPlugin implements Listener
    {
       
        private static Main instance;

        public static Main getInstace()
        {
            return instance;
        }
       
        @Override
        public void onEnable()
        {
            instance = this;
        }
       
        @Override
        public void onDisable()
        {
        }
       
        @EventHandler
        public void onJoin(PlayerLoginEvent e)
        {
            Player p = e.getPlayer();
           
            if (p.hasPlayedBefore())
            {
                p.sendMessage("welcome back!");
            }
            else
            {
                p.sendMessage("welcome new!");
            }
        }
    }
     
  2. onEnable add:

    Code (Java):
    getServer().getPluginManager().registerEvents(this, this);
     
    • Like Like x 1
  3. Thanks!
     
Thread Status:
Not open for further replies.