On Respawn or OnDeath ?

Discussion in 'Plugin Development' started by arnie231, Mar 23, 2012.

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

    arnie231

    Ok I'm Trying to code a plugin that teleports users to a defined area ive sorted it for first joining But i need a little bit of advice if i should use to call the ondeath event or should i use onrespawn event to then do what i need :S

    Thanks in advance for your advice
     
  2. Offline

    Josvth

    Onrespawn fires when a player clicks the respawn button. If you would like to teleport the player I suggest you use onrespawn and use event.setRespawnLocation().
     
  3. Offline

    jamietech

    For first join do a PlayerJoinEvent and use
    (!event.getPlayer().hasPlayedBefore()) {
    // teleport code
    }
     
    Josvth likes this.
  4. Offline

    arnie231

    Yeah ive tested both and it seems that the respawn would be better i just wanted some advice which would be better Etc but thanks

    PS: Spout has change alot and iam confused which Spout API to down load ive tried 2 different ones and both dont seems to import when i call the event :S

    Thanks ive already done that part i was working out if it would be best if to onrepsawn or ondeath for when a player is killed

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 24, 2016
  5. Offline

    jamietech

    Oh derp, I'm terrible at reading!
    Yeah, in that case use a respawn event and event.setRespawnLocation() and just make a new Location
     
  6. Offline

    Josvth

    I didn't know that there was a .hasPlayedBefore() method! Thanks, I will use this.
     
  7. Offline

    arnie231

    I know lol i was using the way of Checkign if the player had a .dat file
     
Thread Status:
Not open for further replies.

Share This Page