Added teleportation to players bed

This commit is contained in:
jimmy1248
2014-03-29 15:48:07 +13:00
parent a9555da45a
commit 404860e8bb
2 changed files with 17 additions and 1 deletions

View File

@@ -10,6 +10,7 @@ public class EasySpawn extends JavaPlugin{
public void onEnable() {
getCommand("spawn").setExecutor(this);
getCommand("setspawn").setExecutor(this);
getCommand("bed").setExecutor(this);
}
@Override
@@ -28,6 +29,13 @@ public class EasySpawn extends JavaPlugin{
player.sendMessage("Spawn set.");
return true;
}
if(command.getName().equalsIgnoreCase("bed")){
if(player.getBedSpawnLocation()!=null){
player.teleport(player.getBedSpawnLocation());
player.sendMessage("You have been teleported to your bed.");
}else sender.sendMessage("Your bed cannot be found.");
return true;
}
}
return false;
}