This will teleport all players on login to a specific location.
Add this to a class implementing Listener and change the position you want to teleport the player to on join.
@EventHandler(priority = EventPriority.LOWEST, ignoreCancelled = true)
public void on(PlayerPreLoginEvent event) {
final Server server = Server.getInstance();
final UUID uuid = Server.uuidFromXUID(event.getIdentityClaims().extraData.xuid);
final Position spawn = new Position(0.5, 125.1, 0.5, server.getDefaultLevel());
if (server.hasOfflinePlayerData(uuid)) {
final CompoundTag nbt = server.getOfflinePlayerData(uuid);
nbt.putString("Level", spawn.getLevel().getName())
.putList("Pos", new ListTag<DoubleTag>()
.add(new DoubleTag(spawn.x))
.add(new DoubleTag(spawn.y))
.add(new DoubleTag(spawn.z)));
server.saveOfflinePlayerData(uuid, nbt, false);
}
}
This snippet is for API 3.0.0 (latest nightly build)