Preventing beds setting player spawn point

Discussion in 'Plugin Development' started by broonie, Feb 9, 2013.

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

    broonie

    How do you prevent a user selecting a bed and setting it as their spawn point?

    Regards
     
  2. Offline

    Yukari

    Could be wrong, but as far as I know there's no way of not having it save the spawnpoint.

    You could prevent people from entering beds, or you could set respawnLocation in PlayerRespawnEvents.
     
  3. Offline

    broonie

    Done, thank you!


    Code:
        @EventHandler
        public void onPlayerRespawn(PlayerRespawnEvent event) {
            if(event.isBedSpawn()) {
                event.setRespawnLocation(event.getPlayer().getServer().getWorld("world").getSpawnLocation());
            }
        }
     
    Yukari likes this.
Thread Status:
Not open for further replies.

Share This Page