From 4c3abd86de2af8c54e3f68594a064108c788be9d Mon Sep 17 00:00:00 2001 From: Alexander Krylov Date: Sat, 24 Oct 2026 22:53:12 +0300 Subject: [PATCH] Player: the window stops ticking its player while the game is paused Air kept draining behind the Escape menu in singleplayer and the drowning damage landed on closing it. The server pauses (`IntegratedServer::set_paused` reads the flag), but the window's own copy of the player kept running `controlled_simulation_tick` every frame, and that is where `tick_environment_damage` decrements the air and pushes `MotionEvent::Drown`. `Minecraft.tick` skips the level while the game is paused, so both local paths now skip the player's simulation: the client of a server (`tick_remote_level`) and in-frame single player. Keys are already neutral when a screen is open, so this only stops the environment, hunger and fall prediction from running ahead of the paused server. Fixes #1592. Co-Authored-By: Hermes Agent (Nous Research) --- crates/horizon-client/src/game.rs | 2 +- crates/horizon-client/src/game/remote.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/horizon-client/src/game.rs b/crates/horizon-client/src/game.rs index bf8327cc1..0998eb553 100644 --- a/crates/horizon-client/src/game.rs +++ b/crates/horizon-client/src/game.rs @@ -4147,7 +4147,7 @@ impl Game<'_> { [player.velocity.x, player.velocity.y, player.velocity.z], [player.position.x, player.position.y, player.position.z], ); - if !riding { + if !riding && !self.pause { MotionWorld { entities: &entity_collisions, player, diff --git a/crates/horizon-client/src/game/remote.rs b/crates/horizon-client/src/game/remote.rs index 32cffa306..e3eed3f55 100644 --- a/crates/horizon-client/src/game/remote.rs +++ b/crates/horizon-client/src/game/remote.rs @@ -3175,7 +3175,10 @@ impl Game<'_> { f64::from(head[2]) + 0.5, ); player.velocity = Vec3::ZERO; - } else if !dead && !riding { + } else if !dead && !riding && !self.pause { + // Minecraft.tick skips the level while the game is paused: the window's own + // copy stands still too, so air, hunger and fall prediction do not run ahead + // of the paused server (#1592). player.velocity = player.velocity.add_vector(pushed); MotionWorld { entities: &entity_collisions,