diff --git a/README.md b/README.md
index 65078464e..ae85f7dbd 100644
--- a/README.md
+++ b/README.md
@@ -31,7 +31,7 @@ Horizon is Minecraft: Java Edition 26.3 rewritten in Rust: a native game that re
Horizon is installed through **the Horizon launcher**. Get it from [playhorizon.dev](https://playhorizon.dev) (the Download button picks your system) or from [the launcher releases](https://github.com/ludovic111/horizon/releases?q=launcher-v&expanded=true), for Linux x86-64, macOS on Apple Silicon or Windows x64. The launcher installs and updates the game, prepares its files from your own copy of Minecraft, and updates itself.
-**You need** Minecraft: Java Edition 26.3, played once (the official launcher, Prism, MultiMC and other launchers all work); a Java 25 runtime, for the one-time preparation; and a GPU with Vulkan on Linux and Windows, or any Apple Silicon Mac. Step by step, with macOS's first-open prompt and the first launch: [Install and first launch](https://playhorizon.dev/docs/install).
+**You need** a Microsoft account that owns Minecraft: Java Edition (the launcher signs in with it, as other launchers do; see [Microsoft account](docs/microsoft-account.md)); Minecraft: Java Edition 26.3, played once (the official launcher, Prism, MultiMC and other launchers all work); a Java 25 runtime, for the one-time preparation; and a GPU with Vulkan on Linux and Windows, or any Apple Silicon Mac. Step by step, with macOS's first-open prompt and the first launch: [Install and first launch](https://playhorizon.dev/docs/install).
@@ -47,7 +47,7 @@ The [documentation](https://playhorizon.dev/docs/) covers each of these.
- **The game:** singleplayer with vanilla's world generation, mobs, villagers, raids, redstone, every command, the HUD and the recipe book, on saves in vanilla's format. Worlds from 1.8 to 26.2 are upgraded as vanilla does. [Status table](#project-status).
- **Horizon's own extras:** new menus (vanilla's are one setting away), graphics presets, distant terrain up to 1024 chunks, controller support, optional zoom, minimap and more, all off by default where they would change the vanilla look. See [Settings](https://playhorizon.dev/docs/settings).
- **Resource packs and data packs:** resource packs work, and data packs load functions, predicates and item modifiers.
-- **Playing with others:** invite friends from the pause menu's Friends button with a code, Open to LAN, and joining offline-mode servers. Horizon cannot sign in to a Microsoft account yet, so it cannot join servers that check accounts. See [Multiplayer](https://playhorizon.dev/docs/multiplayer).
+- **Playing with others:** invite friends from the pause menu's Friends button with a code, Open to LAN, and joining servers, online-mode ones with the Microsoft account the launcher signs in with. See [Multiplayer](https://playhorizon.dev/docs/multiplayer).
- **Mods:** Horizon has its own mod system (Rust compiled to WebAssembly). Java mod jars do not run. See [Mods and data packs](https://playhorizon.dev/docs/mods).
Screenshots, captured in the Rust client itself with vanilla assets and no mods or shaders:
@@ -158,7 +158,7 @@ them too (Rust uses Java's own float maths on each platform).
### Known issues
-Horizon can't sign in to a Microsoft account yet, so it can't join online-mode servers (it joins offline-mode ones); skins served over https show the default skin unless already cached; pack icons show the unknown-pack texture in game; the creative hotbar keys (C/X) aren't wired to the hotbar loader; item tooltips lack attribute lines.
+Skins served over https show the default skin unless already cached; pack icons show the unknown-pack texture in game; the creative hotbar keys (C/X) aren't wired to the hotbar loader; item tooltips lack attribute lines.
## Licence
diff --git a/docs/launcher-commands.md b/docs/launcher-commands.md
index 900a10283..df098faa6 100644
--- a/docs/launcher-commands.md
+++ b/docs/launcher-commands.md
@@ -46,7 +46,7 @@ MCP: `prepare`.
## `horizon-launcher play`
-Start the client.
+Start the client (needs a signed-in Microsoft account that owns Minecraft: Java Edition).
horizon-launcher play
@@ -98,7 +98,7 @@ MCP: `account_list`.
## `horizon-launcher account sign-in`
-Sign in with a Microsoft account in your browser (device code).
+Sign in with a Microsoft account in your browser (device code). Play needs one that owns Minecraft: Java Edition.
horizon-launcher account sign-in
@@ -126,7 +126,7 @@ MCP: `account_select`.
## `horizon-launcher account offline`
-Play offline, without an account: as NAME (kept to switch back to; 3 to 16 letters, digits or _), or as the name the game made up.
+Play offline (LAN, offline-mode servers) beside a signed-in account that owns the game: as NAME (kept to switch back to; 3 to 16 letters, digits or _), or as the name the game made up.
horizon-launcher account offline [NAME]
diff --git a/docs/microsoft-account.md b/docs/microsoft-account.md
index 380aa0785..314115fb3 100644
--- a/docs/microsoft-account.md
+++ b/docs/microsoft-account.md
@@ -1,14 +1,16 @@
# Microsoft account sign-in and online-mode play
Horizon signs players in with their Microsoft account in the launcher and joins online-mode
-(authenticated) servers like vanilla 26.3 does. Offline profiles and offline/LAN play stay exactly as
-they are. This note is the design, the status of each part and what Ludovic has to register.
+(authenticated) servers like vanilla 26.3 does. The launcher plays only with an account that owns
+Minecraft: Java Edition ([the owner gate](#the-owner-gate)); offline names, LAN and offline-mode
+servers play behind it. This note is the design, the status of each part and what Ludovic has to
+register.
## What Ludovic registers (needs his accounts)
-Nothing below can be done by an agent: the app registrations belong to Ludovic. Until the client ID
-is set, the launcher's sign-in shows "Coming soon" ("Microsoft sign-in is coming soon") and everything else
-works as before.
+Nothing below can be done by an agent: the app registrations belong to Ludovic. A build without
+the client ID can't sign in, so its launcher can't start the game ("This build of the launcher has
+no Microsoft sign-in"); release builds have it.
1. **Azure app registration** (https://portal.azure.com → Microsoft Entra ID → App registrations →
New registration):
@@ -64,14 +66,38 @@ All requests use HTTPS and JSON except the two OAuth calls (form-encoded):
7. **Profile**: `GET https://api.minecraftservices.com/minecraft/profile`: UUID, name, skins, capes.
404 = owns the game but has no profile yet ("Create your Minecraft profile on minecraft.net first").
+## The owner gate
+
+Decided 2026-10-27 (Ludovic, after a modder's suggestion): like other launchers, Horizon's
+launcher starts the game only while an account in it owns Java Edition. Offline play stays
+possible; the launcher just doesn't offer it on its own.
+
+- **Play needs an owner.** Every Play (Home, instances and packs, `horizon-launcher play`,
+ `modpack play`, the MCP's `play`) asks `account::launch` first. It asks the Minecraft services
+ again for each account, the selected one first, until one owns the game: the token renewal
+ (below) if due, then entitlements and profile. Without an owner the game doesn't start and Play
+ says "Sign in with a Microsoft account that owns Minecraft: Java Edition to play", with Sign in.
+- **The answer lives with the tokens.** Each account's keychain item keeps the last answer
+ (`owns`), so no plain file can say yes. With no network (or a sign-in that can't be renewed) the
+ last answer stands: being offline never blocks a player who passed before, and the game starts
+ without a session, offline. An answer of "doesn't own" (or no profile) blocks at once.
+- **Offline names play behind an owner.** They can be added and played only while an owning
+ account is signed in. Signing the last one out keeps them, and they play again once one is back.
+- **Who isn't affected:** the game binary itself (`horizon-client`, `horizon-ctl launch`, the
+ harnesses, CI), the dedicated server and `horizon-server`, the website. There is no bypass flag:
+ the launcher's tests use accounts in a memory store (`MemoryStore`, and `HORIZON_NO_KEYCHAIN`
+ for the CLI and MCP tests, which then have no owner).
+
Refresh: the Minecraft token is renewed from the Microsoft refresh token (steps 2-5 with
-`grant_type=refresh_token`) when it has less than an hour left, before every launch. A refused
+`grant_type=refresh_token`) when it has less than an hour left, before every launch; steps 6-7 run
+at every launch (the owner gate). A refused
refresh token (`invalid_grant`) asks the player to sign in again. Several accounts can be signed in;
one is selected. "Sign out" deletes the account's secrets from the keychain.
## Token storage
-- Secrets (the Microsoft refresh token, the Minecraft access token and its expiry) go to the OS
+- Secrets (the Microsoft refresh token, the Minecraft access token and its expiry, the last
+ ownership answer) go to the OS
keychain, one item per account: Keychain on macOS, Credential Manager on Windows, the Secret
Service (GNOME Keyring, KWallet) on Linux. Service name `dev.playhorizon.launcher`, account = the
Minecraft UUID.
diff --git a/launcher/README.md b/launcher/README.md
index 6aec8b633..b2b497753 100644
--- a/launcher/README.md
+++ b/launcher/README.md
@@ -124,7 +124,9 @@ The opening, then Play ([clip](docs/opening.webm)):
[instance] [--remove]`; `HORIZON_LAUNCHER_DESKTOP` points it at another folder.
- **Accounts and quick switch**: the top bar's account chip opens a menu of everyone who can play:
each signed-in Microsoft account, the offline names the player keeps, and the name the game
- made up (`horizon-player.txt`). Picking one plays as it from the next Play. Settings > Account
+ made up (`horizon-player.txt`). Picking one plays as it from the next Play. Offline names play
+ only while an account that owns the game is signed in ([Microsoft accounts](#microsoft-accounts));
+ signing the last one out keeps them, unplayable until one is back. Settings > Account
adds offline names (3 to 16 letters, digits or `_`; the game gets `--name`) and forgets them;
the Console's Share log takes them out of the log too. `horizon-launcher account offline
[NAME]`, `account select ` (an account or an offline name), `account forget-offline
@@ -364,10 +366,15 @@ The window, the command line and the MCP server all call the same core, `src/bac
## Microsoft accounts
-Settings → Accounts signs in a Microsoft account to play on online-mode servers under your own
-name and skin: the launcher shows a code, you enter it at microsoft.com/link, and the launcher
-checks that the account owns Minecraft: Java Edition. The Play page says who plays ("Playing as");
-without an account the game plays offline, as before. Tokens live in the system keychain (Keychain,
+The launcher starts the game only while a Microsoft account that owns Minecraft: Java Edition is
+signed in, as other launchers do: without one, Play (Home, instances, `horizon-launcher play`, the
+MCP's `play`) says "Sign in with a Microsoft account that owns Minecraft: Java Edition to play"
+and starts nothing. Settings → Accounts signs in: the launcher shows a code, you enter it at
+microsoft.com/link, and the launcher checks that the account owns the game. It asks again at every
+Play, with the token renewal; with no network the last answer stands, and a "doesn't own" blocks
+at once. The account also plays online-mode servers under your own name and skin; offline names
+play LAN and offline-mode servers beside it. The game binary started directly (`horizon-client`,
+`horizon-ctl launch`), the harnesses and the servers don't go through this check. Tokens live in the system keychain (Keychain,
Credential Manager, or the Secret Service on Linux), never in a file, a log or the command line;
`accounts.json` in the data folder keeps only names and UUIDs. Without a keychain you stay signed
in until the launcher closes. When the game starts, it gets the session in a private file it
diff --git a/launcher/lang/fr.json b/launcher/lang/fr.json
index b92252a92..f15700ad3 100644
--- a/launcher/lang/fr.json
+++ b/launcher/lang/fr.json
@@ -48,11 +48,8 @@
"Applications menu": "Menu des applications",
"Horizon and its icon are in your desktop's menu.": "Horizon et son icône sont dans le menu de votre bureau.",
"Not in your desktop's menu.": "Pas dans le menu de votre bureau.",
- "Microsoft account (coming soon)": "Compte Microsoft (bientôt)",
"Microsoft account": "Compte Microsoft",
"Another account": "Un autre compte",
- "Microsoft sign-in is coming soon. Until then the game plays offline: single player, LAN and servers in offline mode work.": "La connexion Microsoft arrive bientôt. D'ici là, le jeu se joue hors ligne : solo, LAN et serveurs en mode hors ligne fonctionnent.",
- "Coming soon": "Bientôt",
"Microsoft account · plays": "Compte Microsoft · joue",
"Microsoft account · signed in": "Compte Microsoft · connecté",
"Asking Microsoft…": "Demande à Microsoft…",
@@ -165,5 +162,10 @@
"Installing the nightly, {percent}%": "Installation de la Nightly, {percent} %",
"The nightly could not be installed: {error}": "La Nightly n'a pas pu être installée : {error}",
"{version} in the Nightly instance. Choose Horizon in the sidebar to play the release.": "{version} dans l'instance Nightly. Choisissez Horizon dans la barre latérale pour jouer la version publiée.",
- "No nightly build yet.": "Pas encore de version Nightly."
+ "No nightly build yet.": "Pas encore de version Nightly.",
+ "This build of the launcher has no Microsoft sign-in (HORIZON_MSA_CLIENT_ID), so it can't start the game.": "Cette version du launcher n'a pas de connexion Microsoft (HORIZON_MSA_CLIENT_ID) : elle ne peut pas lancer le jeu.",
+ "Sign in with a Microsoft account that owns Minecraft: Java Edition to play": "Connectez-vous avec un compte Microsoft qui possède Minecraft: Java Edition pour jouer",
+ "Horizon needs a Microsoft account that owns Minecraft: Java Edition, like other launchers. It also plays online servers with your name and skin.": "Horizon a besoin d'un compte Microsoft qui possède Minecraft: Java Edition, comme les autres launchers. Il permet aussi de jouer sur les serveurs en ligne avec votre nom et votre skin.",
+ "Sign in": "Se connecter",
+ "Sign in with Microsoft": "Se connecter avec Microsoft"
}
diff --git a/launcher/lang/ru.json b/launcher/lang/ru.json
index 753132e4b..ca14e22d7 100644
--- a/launcher/lang/ru.json
+++ b/launcher/lang/ru.json
@@ -48,11 +48,8 @@
"Applications menu": "Меню приложений",
"Horizon and its icon are in your desktop's menu.": "Horizon и его значок есть в меню рабочего стола.",
"Not in your desktop's menu.": "Нет в меню рабочего стола.",
- "Microsoft account (coming soon)": "Аккаунт Microsoft (скоро)",
"Microsoft account": "Аккаунт Microsoft",
"Another account": "Другой аккаунт",
- "Microsoft sign-in is coming soon. Until then the game plays offline: single player, LAN and servers in offline mode work.": "Вход через Microsoft скоро появится. А пока игра работает офлайн: одиночная игра, LAN и серверы в офлайн-режиме.",
- "Coming soon": "Скоро",
"Microsoft account · plays": "Аккаунт Microsoft · играет",
"Microsoft account · signed in": "Аккаунт Microsoft · вход выполнен",
"Asking Microsoft…": "Запрос к Microsoft…",
@@ -165,5 +162,10 @@
"Installing the nightly, {percent}%": "Установка ночной сборки, {percent}%",
"The nightly could not be installed: {error}": "Не удалось установить ночную сборку: {error}",
"{version} in the Nightly instance. Choose Horizon in the sidebar to play the release.": "{version} в сборке Nightly. Выберите Horizon на боковой панели, чтобы играть в релиз.",
- "No nightly build yet.": "Ночных сборок пока нет."
+ "No nightly build yet.": "Ночных сборок пока нет.",
+ "This build of the launcher has no Microsoft sign-in (HORIZON_MSA_CLIENT_ID), so it can't start the game.": "В этой сборке лаунчера нет входа через Microsoft (HORIZON_MSA_CLIENT_ID), поэтому она не может запустить игру.",
+ "Sign in with a Microsoft account that owns Minecraft: Java Edition to play": "Чтобы играть, войдите в аккаунт Microsoft, у которого есть Minecraft: Java Edition",
+ "Horizon needs a Microsoft account that owns Minecraft: Java Edition, like other launchers. It also plays online servers with your name and skin.": "Как и другим лаунчерам, Horizon нужен аккаунт Microsoft, у которого есть Minecraft: Java Edition. С ним вы также играете на онлайн-серверах под своим именем и со своим скином.",
+ "Sign in": "Войти",
+ "Sign in with Microsoft": "Войти через Microsoft"
}
diff --git a/launcher/src/account.rs b/launcher/src/account.rs
index 257055911..751e58232 100644
--- a/launcher/src/account.rs
+++ b/launcher/src/account.rs
@@ -1,8 +1,13 @@
//! Microsoft account sign-in (docs/microsoft-account.md): the OAuth device-code flow, then Xbox
//! Live, XSTS and the Minecraft services, the game ownership check and the profile. Secrets (the
-//! Microsoft refresh token, the Minecraft access token) live in the OS keychain; accounts.json
-//! keeps only names and UUIDs. The game gets the session in a file it reads once
-//! (`--session-file`), never on its command line. Tokens never reach logs, errors or output.
+//! Microsoft refresh token, the Minecraft access token, the last ownership answer) live in the OS
+//! keychain; accounts.json keeps only names and UUIDs. The game gets the session in a file it
+//! reads once (`--session-file`), never on its command line. Tokens never reach logs, errors or
+//! output.
+//!
+//! The owner gate ([`launch`]): the launcher starts the game only while an account in it owns
+//! Minecraft: Java Edition, as other launchers do. Offline names play behind such an account.
+//! The game binary itself, its harnesses and the servers don't go through the launcher's gate.
//!
//! The Azure app (client ID) is Horizon's own and is configuration: `HORIZON_MSA_CLIENT_ID` at
//! build time, or at run time to override it. Without one, sign-in says it is not configured.
@@ -16,8 +21,15 @@ use std::time::{Duration, SystemTime, UNIX_EPOCH};
pub const SERVICE: &str = "dev.playhorizon.launcher";
const SCOPE: &str = "XboxLive.signin offline_access";
pub const NOT_CONFIGURED: &str =
- "Microsoft sign-in is coming soon. Until then the game plays offline: single player, \
- LAN and servers in offline mode work.";
+ "This build of the launcher has no Microsoft sign-in (HORIZON_MSA_CLIENT_ID), so it can't start the game.";
+/// What every Play says while no account in the launcher owns the game.
+pub const NEEDS_OWNER: &str =
+ "Sign in with a Microsoft account that owns Minecraft: Java Edition to play";
+const DOES_NOT_OWN: &str = "This account doesn't own Minecraft: Java Edition.";
+const NO_PROFILE: &str =
+ "This account has no Minecraft profile yet. Create one at minecraft.net, then sign in again.";
+const OTHER_PROFILE: &str =
+ "The Microsoft account now has another Minecraft profile. Sign in again.";
const SIGN_IN_AGAIN: &str = "Your Microsoft sign-in expired. Sign in again.";
/// The Minecraft token is renewed when it has less than this left.
const RENEW_BEFORE: u64 = 3600;
@@ -393,7 +405,8 @@ pub struct Account {
pub cape: Option,
}
-fn profile(ep: &Endpoints, token: &str) -> Result {
+/// The profile; none when the account has none (it doesn't own the game, or never made one).
+fn profile(ep: &Endpoints, token: &str) -> Result