Events not working

Discussion in 'Plugin Development' started by R0ut66, Dec 12, 2018.

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

    R0ut66

    PHP:
    public class SistemaDeLogin extends JavaPlugin implements Listener {
       
       
        @
    Override
        
    public void onEnable() {
            
    // TODO Insert logic to be performed when the plugin is enabled
            
    getLogger().info("onEnable has been invoked!");
            
    PluginManager pm getServer().getPluginManager();
            
    pm.registerEvents(new EventsListener(), this);
        }
    public class 
    EventsListener implements Listener {
        @
    EventHandler
        
    public void loginHandler(PlayerLoginEvent event) {   
            
    event.getPlayer().sendMessage("EAE");
            
    event.getPlayer().sendTitle("Bem-vindo (a)""/registrar <senha> <senha>"107020);
        }
        }
    Hello, what is wrong with my code?
     
  2. Offline

    Zombie_Striker

    @R0ut66
    1. You do not need to log your own plugins. Bukkit does this for you by default.
    2. PlayerLoginevent is called before the player is officially online (its called when they are still on the dirt-menu screen). Instead, use PlayerJoinEvent, which is called when the player is in the world.
     
Thread Status:
Not open for further replies.

Share This Page