Added teleportation to players bed
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user