Difference between PlayerJoinEvent and PlayerLoginEvent?

Discussion in 'Plugin Development' started by NerdsWBNerds, May 21, 2012.

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

    NerdsWBNerds

    What are the differences between these two events?
    When a player joins my server, I need to change his gamemode and teleport him, but whenever I add the code here, the person gets kicked for internal service error once, then they can join.
    Please help.

    Here is the error I get when I try to teleport/gm when they join.

    Code:
    21.05 16:58:09 [Server] INFO java.lang.IllegalStateException: Failed to add player. net.minecraft.server.EntityPlayer@e970(airnoah at -1577.0,61.0,-611.0) already is in chunk -99, -39
    21.05 16:58:09 [Server] WARNING Failed to handle packet: java.lang.IllegalStateException: Failed to add player. net.minecraft.server.EntityPlayer@e970(airnoah at -1577.0,61.0,-611.0) already is in chunk -99, -39
    21.05 16:58:09 [Server] INFO Disconnecting xxx [xx.xx.xx.xx]: Internal server error
    
    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 25, 2016
  2. Offline

    Drew1080

    PlayerLoginEvent

    This event is used when the player first presses the connect button to login to the server. You usually check here if a player is banned etc.

    PlayerJoinEvent

    This event is called when a player has successfully logged onto the server.
    This is the event you use if you want to have a motd. Or just a welcome message.
     
    HeroCC, DogisPlz, au2001 and 3 others like this.
Thread Status:
Not open for further replies.

Share This Page