Force player respawn

Discussion in 'Plugin Development' started by gmfreaky, Jun 9, 2012.

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

    gmfreaky

    Hello all,

    quick question here: I'm trying to force a respawn upon a player to a certain location. To do this I try to call a PlayerRespawnEvent, using the following code:

    Code:
    getServer().getPluginManager().callEvent(new PlayerRespawnEvent(p, getSpawnPoint(spawnLocation), false));
    This, however, has no effect on the player. Is there an official function to respawn a player? I've tried removing the player entity using .remove(), but that crashed my game.

    Thanks for reading this post, hopefully I can get an answer soon :)

    Robin
     
  2. why yuo dont teleport the player to that location?
     
Thread Status:
Not open for further replies.

Share This Page