From d1c75da14b02ba7a7e324e68004d0335c5c7f227 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Tue, 20 Sep 2022 21:53:51 +0100 Subject: [PATCH] Player: lock flight state in spectator mode players should not be able to stop flying in spectator mode --- src/player/Player.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/player/Player.php b/src/player/Player.php index 336ff6f8c3..7a32e7a483 100644 --- a/src/player/Player.php +++ b/src/player/Player.php @@ -1021,7 +1021,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{ protected function internalSetGameMode(GameMode $gameMode) : void{ $this->gamemode = $gameMode; - $this->allowFlight = $this->isCreative(); + $this->allowFlight = $this->gamemode->equals(GameMode::CREATIVE()); $this->hungerManager->setEnabled($this->isSurvival()); if($this->isSpectator()){