Anyone know a way to set a player's spawn without using sudo? I don't want the player to have permissions to do /spawnpoint. I tried the following code already but it isnt very efficient. Code: Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "sudo "+ p.getName() + " spawnpoint");
I'm confused on what you're asking. When do you the spawnpoint to be set? On command, or on player join?
On player join But the spawn has to be changeable EDIT by Moderator: merged posts, please use the edit button instead of double posting.
p.getLocation().getWorld().setSpawnLocation((int)p.getLocation().getX(), (int)p.getLocation().getY(), (int)p.getLocation().getZ());
aguy867867 Could always look at how /spawnpoint does the setting https://github.com/Bukkit/Bukkit-Bl...t/command/defaults/SpawnpointCommand.java#L47