package dk.thoerup.bukkit.hoeruputils; import org.bukkit.Location; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; import org.bukkit.entity.Player; public class GetposCommand implements CommandExecutor { @Override public boolean onCommand(final CommandSender sender, Command command, String label, String[] args) { if (! (sender instanceof Player) ) { return false; } Player p = (Player) sender; Location l = p.getLocation(); String message = String.format("Your current location is %d,%d,%d", (int)l.getX(), (int)l.getY(), (int)l.getZ() ); p.sendMessage(message); p.sendMessage( String.format("%f, %f", l.getPitch(), l.getYaw()) ); //needs to print facing direction // TODO Auto-generated method stub return true; } }