So I am basicly making a Warping system but I am using it for a minigame. I want the owners of the server to be able to set the warp for the different players to spawn in when the minigame starts. For some reason, I am getting a error which is saying that I cannot teleport the player, here is my code for the teleporting part:
if(cmd.getName().equalsIgnoreCase("cakestart")){
if(getConfig().contains("locations." + args[0])){
int locationsX = this.getConfig().getInt("locations" + args[0] + ".X");
int locationsY = this.getConfig().getInt("locations" + args[0] + ".Y");
int locationsZ = this.getConfig().getInt("locations" + args[0] + ".Z");
int locationsYaw = this.getConfig().getInt("locations" + args[0] + ".Yaw");
int locationsPitch = this.getConfig().getInt("locations" + args[0] + ".Pitch");
Object locationsworld = this.getConfig().get("locations" + args[0] + ".World");
Location cakestart = new Location((World) locationsworld, locationsX, locationsY, locationsZ, locationsYaw, locationsPitch);
p.teleport(cakestart);
p.sendMessage("TPED!");
}
}
The error is happening with:
p.teleport(cakestart);
I can give any more info you need.