You might want to check to see if “homesConfig.contains(“Homes.” + user.getName() + )” before you try to use it. I think getting something that the config file doesn’t contain will just return null.
Here’s how you could check it
if (!homesConfig.contains("Homes." + user.getName() + ".world") || <just copy the first condition but for the different elements, like x, y, z, ect>) {
user.sendMessage(ChatColor.RED + "No home set");
return true;
}
I haven’t tested this code, but it could work. Also pogostick29dev has a lot of bukkit tutorials, one covers settings managers, if you wanted to check him out.
3
solved Java bukkit config file for player homes not allowing teleportation