onPlayerJoin half working?

Discussion in 'Plugin Development' started by Phinary, Jul 9, 2012.

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

    Phinary

    Okay so, I made this onPlayerJoin listener, and made it so it should send a message to the player and set them on fire when they join the server. For some reason, only the setting the person on fire is working but sending them a message isn't. Can someone please help me out?


    Code:
        @EventHandler
        public void normalLogin(PlayerLoginEvent event) {
            Player player = event.getPlayer();
            player.sendMessage("Welcome!");
            player.setFireTicks(100);
        }
     
  2. Offline

    one4me

    Use PlayerJoinEvent instead. The player hasn't actually joined the server when you use PlayerLoginEvent, so the player won't see the message.
     
  3. Offline

    mcgamer99

    Miss the return statment and use the PlayerJoinEvent instead of the PlayerLoginEvent, try this:
    Code:
    @EventHandler
        public void normalLogin(PlayerJoinEvent event) {
            Player player = event.getPlayer();
            player.sendMessage("Welcome!");
            player.setFireTicks(100);
            return;
    }
     
Thread Status:
Not open for further replies.

Share This Page