Cancel Bed Respawns?

Discussion in 'Plugin Development' started by Tauryuu, Dec 27, 2011.

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

    Tauryuu

    I tried to teleport the player to spawn on the player's respawn, but it didn't do anything.
     
  2. Offline

    nisovin

    The respawn event has a method to set the respawn location. You should use that.
     
  3. Offline

    Jaker232

    What? Do what nisovin says.
     
  4. Offline

    Gravity

    Code:
        public void onPlayerRespawn(PlayerRespawnEvent event)
        {
            Player player = event.getPlayer();
            event.setRespawnLocation(player.getWorld().getSpawnLocation());
        }
     
    AlbireoX likes this.
  5. Offline

    fromgate

    Hello I need to prevent second bed respawn. (not first). For example, after first player respawn player appears near his bed, but when he respawned second time he will move to world's spawn. If he want to respawn in bed again he will wait until night sleep in and sleep in this bed again.
    How I can clear bedrespawn from player after his first bedrespawn?
     
  6. Offline

    Father Of Time

    a players bed location is stored in the player data files stored in plugins/Essentials/data (I think this is the directory). You wouldn't even need to alter Essentials at all, simply make a plugin that monitors when a player gets out of a bed (oddly enough there is an event for this), and when they do locate a file in that directory with their name, find the bed location node and set it to spawn.

    Good luck with your project!:D
     
Thread Status:
Not open for further replies.

Share This Page